in reply to Two threaded program

Seems to me that the problem described would be better suited to fork/wait rather than using threads at all. Of course it may be that the description of the problem has been simplified too far.