Suspending/resuming processes

Igor Stasenko siguctua at gmail.com
Thu Dec 20 22:09:08 UTC 2007


> > <snip>
> > No, i'm specially doing Processor yield to make proc start waiting for
> > semaphore.
>
> Er... oh, I see. From my point of view (which consists of little format
> training wrt Process management), you're mis-treating these poor objects.
> The code would work... but I'd never write code like that.
>
Oh please. How i can mis-treat them. All what i wanted is to call
suspend followed by resume.
It's not my fault that it's not works as expected in all cases :)

> If you want to use #critical:, you should be making the Semaphore with "sema
> := Semaphore forMutualExclusion".
>
Semaphore forMutualExclusion creates an initially signaled semaphore.
If created in that way, it will not expose an issue.

> "Processor yield" shouldn't ever be used IMHO. It relies on particular
> behaviour of the scheduler. In a future version of Squeak when we properly
> support pthreads or we "improve" the behaviour of the scheduler, your code
> might not work as expected.
>

P.S. added a bug report to mantis
http://bugs.squeak.org/view.php?id=6822

-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list