Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
18
Task/Concurrent-computing/J/concurrent-computing-1.j
Normal file
18
Task/Concurrent-computing/J/concurrent-computing-1.j
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
reqthreads=: {{ 0&T.@''^:(0>.y-1 T.'')0 }}
|
||||
dispatchwith=: (t.'')every
|
||||
newmutex=: 10&T.
|
||||
lock=: 11&T.
|
||||
unlock=: 13&T.
|
||||
synced=: {{
|
||||
lock n
|
||||
r=. u y
|
||||
unlock n
|
||||
r
|
||||
}}
|
||||
register=: {{ out=: out, y }} synced (newmutex 0)
|
||||
task=: {{
|
||||
reqthreads 3 NB. at least 3 worker threads
|
||||
out=: EMPTY
|
||||
#@> register dispatchwith ;:'Enjoy Rosetta Code'
|
||||
out
|
||||
}}
|
||||
8
Task/Concurrent-computing/J/concurrent-computing-2.j
Normal file
8
Task/Concurrent-computing/J/concurrent-computing-2.j
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
task''
|
||||
Enjoy
|
||||
Rosetta
|
||||
Code
|
||||
task''
|
||||
Enjoy
|
||||
Code
|
||||
Rosetta
|
||||
Loading…
Add table
Add a link
Reference in a new issue