Concurrent computing: Difference between revisions

m
→‎{{header|Sidef}}: added a random sleep, to guarantee a random order
m (→‎{{header|Sidef}}: added a random sleep, to guarantee a random order)
Line 1,389:
=={{header|Sidef}}==
A very basic threading support is provided by the '''Block.fork()''' method:
<lang ruby>var a = <Enjoy Rosetta Code>
 
.map{|str| {say str}.fork }
a.map{|thrstr| thr.wait };</lang>
{ Sys.sleep(1.rand)
say str
}.fork
}.map{|thr| thr.wait }</lang>
 
{{out}}
2,747

edits