APL-related discussions - a stream of APL consciousness.
Not sure where to start a discussion ? Here's the place to be
Forum rules
This forum is for discussing APL-related issues. If you think that the subject is off-topic, then the Chat forum is probably a better place for your thoughts !
Although designed to help navigate the tortuous paths they lead us down, ⎕TGET has little if any direct interaction with threads.
Thread numbers are not tokens although in some circumstances it might be useful to use them as such.
In your example ⎕TGET is awaiting three tokens of types that happen to correspond to the thread numbers arbitrarily assigned previously. Unless you could predict what thread numbers were to be assigned and ⎕TPUT corresponding tokens beforehand; or ⎕TPUT each as it was assigned, you will always wait for the full timeout without which ⎕TGET would await an interrupt.
This discussion thread begs a question: is there material about using all these quadT functions besides in the reference books? I'm guessing these can be used to build thread-safe code, and I'm sure experimentation will bear fruit, but just in case this path has been covered before...
I'm not aware of any more documentation, but Dan might have some - I've got a large number of examples because DFS uses tokens to co-ordinate its threads
Also it uses the optional ability to associate a value with a token to pass information between threads