From: Rick M. <obj...@gm...> - 2008-04-04 11:01:59
|
Not sure I can say where the problem is, though I expect something unexpected is happening with the Linux semaphores. I'm not seeing any problems with this on Windows, going as high as 100 without problem. The semaphoring would be the only platform-specific aspect of the GUARD instruction. Rick On Thu, Apr 3, 2008 at 4:36 PM, Moritz Hoffmann <ant...@gm...> wrote: > Hello, > tonight I tried to implement a very basic lock facility, mainly for > personal interest as rexx comes with the guard instructions, so a lock > class can be emulated by the intruction. > > However, I ran accross a potential glitch when using the guard [on|off] > when ... instruction. What I do is that I check a counter against a > defined maximum value, and when it is reached I want the application to > continue. > > Sample code: > > .test~new > > ::CLASS Test > ::METHOD Init > expose cnt > max = 5 -- Change to 10 to hang > cnt = 0 > do i = 1 to max > self~run > end > trace i > guard on when cnt = max > > ::METHOD run UNGUARDED > expose cnt > reply > trace i > guard on > cnt+=1 > guard off > > > This codes works fine for me, it waits for all thread to end and > terminates then. When I change the max value to any number bigger 7 the > application will hang after the seventh evaluation of the guard > instruction. On top of this it is not possible to quit the application > using Ctrl+C, debugging it in gdb shows a damaged stack trace. I guess > this is not intended... > > Running ooRexx from SVN trunk, Linux 2.6.19. > > Maybe someone can help... > > Best Regards, Moritz > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Oorexx-devel mailing list > Oor...@li... > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > |