Comments
Loading Dream Comments...
You must be logged in to write a comment - Log In
Let's say two threads A and B want to talk to each other, and we have mapped address register 50 (@50) to them (address registers are automatically shared between threads in the same task). A Buf WOO will be used as a "mailbox" or "pipe".
Thread A :
@50!WOO << "Hello";
{? @50!WOO ?}; // Wait for WOO;
ttyout ("Thread A read ", @50!WOO, CRLF); // Print the result;
Thread B :
{? @50!WOO ?}; // Wait for WOO;
ttyout ("Thread B read ", @50!WOO, CRLF);
@50!WOO << "Squishy"; // Send a reply;