##- # Author: Brian Tiffin # Dedicated to the public domain # # Date: September, 2016 # Modified: 2016-12-25/22:16-0500 ##+ # # Attrib.icn, Demonstrate thread attributes # # requires Concurrency build of Unicon # $include "threadh.icn" import threads global pT, cT procedure main() # spin up the producer, then await completion pT := thread producer() wait(pT) # spin up the consumer, then await completion cT := thread consumer(pT) wait(cT) write("main complete") end procedure producer() write("pT OUTBOX_SIZE: ", Attrib(pT, OUTBOX_SIZE)) Attrib(pT, OUTBOX_LIMIT, 3) # send 10 numbers, but limit is 3, non blocking write("producer sending") every !10@> write("pT OUTBOX_SIZE: ", Attrib(pT, OUTBOX_SIZE)) end procedure consumer(T) write("consumer receiving from producer public outbox") while write(<@T) end