Is there a way to tell if a program is still running a method?
<p>I'm running a method from my main that generates data and I also fork a thread that monitors a queue that the method is writing to and if there's data it saves it to a disk.</p>

<p>My problem is in the past I would multi-thread it and was able to monitor the life of other threads but I'm not sure how to do that if its just the main method? The issue the method is generating data slowly and using sleep or !queue.empty() doesn't work as as soon as it empties the queue the forked file writer process stops.</p>

<p>I know worst case I can write to the file in the method generating the data, but other than that is there anything I can do to monitor if another method is still being executed?</p>
