all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,28 @@
|
|||
'input.txt' as src_file
|
||||
|
||||
class Queue
|
||||
|
||||
new list as items
|
||||
condition as ready
|
||||
|
||||
define item_put
|
||||
items push ready notify
|
||||
|
||||
define item_get
|
||||
items empty if ready wait
|
||||
items shift
|
||||
|
||||
Queue as lines
|
||||
Queue as count
|
||||
|
||||
thread reader
|
||||
"file://r:%(src_file)s" open each lines.item_put
|
||||
NULL lines.item_put count.item_get "reader: %d\n" print
|
||||
|
||||
thread writer
|
||||
0 repeat lines.item_get dup while
|
||||
"writer: %s" print 1+
|
||||
drop count.item_put
|
||||
|
||||
reader as r
|
||||
writer as w
|
||||
Loading…
Add table
Add a link
Reference in a new issue