Concurrent computing: Difference between revisions

Content added Content deleted
m (Updated code to match task, removed output as defined by task.)
m (Updated code to match task, removed output as defined by task.)
Line 1,529: Line 1,529:


=={{header|Sidef}}==
=={{header|Sidef}}==
A very basic threading support is provided by the '''Block.fork()''' method:
<lang ruby>var a = <Enjoy Rosetta Code>
<lang ruby>var a = <Enjoy Rosetta Code>
a.map{|str| {

Sys.sleep(1.rand)
a.map{|str|
{ Sys.sleep(1.rand)
say str
say str
}.fork
}.fork
}.map{|thr| thr.wait }</lang>
}.map{|thr| thr.wait}</lang>

{{out}}
<pre>
Enjoy
Code
Rosetta
</pre>


=={{header|Swift}}==
=={{header|Swift}}==