I have code in the following general form:
while ...:
createThread(...)
...
joinThreads(...)
It works the first iteration, but the threads don't seem to start on the 2nd
iteration. Is there any reason/workaround for this?
One obvious workaround would be to make the threads global, so they only have
to be started once. However, the general structure of the program is something
like
A
B
C
A
B
C
...
where threads will be doing something different in A, B and C -- so having to
have all threads global requires a good bit more complexity.