Metered concurrency: Difference between revisions

Content deleted Content added
No edit summary
Line 267:
t.join()
</pre>
 
==[[Raven]]==
[[Category:Raven]]
 
Counting semaphores are built in:
 
# four workers may be concurrent
4 semaphore as sem
thread worker
5 each as i
sem acquire
# tid is thread id
tid "%d acquired semaphore\n" print
2000 ms
sem release
# let others acquire
100 ms
# start 10 threads
group
10 each drop worker
list as workers
 
Thread joining is automatic by default.