June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,20 @@
|
|||
function inputlines(txtfile, iochannel)
|
||||
for line in readlines(txtfile)
|
||||
Base.put!(iochannel, line)
|
||||
end
|
||||
Base.put!(iochannel, nothing)
|
||||
println("The other task printed $(take!(iochannel)) lines.")
|
||||
end
|
||||
|
||||
function outputlines(iochannel)
|
||||
totallines = 0
|
||||
while (line = Base.take!(iochannel)) != nothing
|
||||
totallines += 1
|
||||
println(line)
|
||||
end
|
||||
Base.put!(iochannel, totallines)
|
||||
end
|
||||
|
||||
c = Channel(0)
|
||||
@async inputlines("filename.txt", c)
|
||||
outputlines(c)
|
||||
Loading…
Add table
Add a link
Reference in a new issue