I don't see why you can't do this all in one thread, as tasks are not parallel, but here's a couple of notes. Instead of checking variable value in a loop, use cond_wait and cond_signal (see threads::shared). Wrap read/write loop into eval block, so you could catch any errors and still send signal to waiting thread to exit.
In reply to Re: Two threaded program
by zwon
in thread Two threaded program
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |