(no subject)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

(no subject)

Florin Mateoc-4
 
thinking some more about it, I think the implementation should respect the comment.
Clearly, as it is, we can put the same process on multiple lists, which seems very wrong. Also, a process that stopped executing by waiting on a semaphore has started executing again without the semaphore being signalled, and with the process still on the semaphore's list.

| evaluationProcess result sema testProcess |
sema := Semaphore new.
testProcess := Processor activeProcess.
result := OrderedCollection new.
evaluationProcess := [
   result add: testProcess isBlocked.
   testProcess resume.
   result add: testProcess isBlocked.
   result add: (sema includes: testProcess).
] fork.
sema wait.
result