0

I am new to Python and threading. I have two threads t1 and t2. The thread t1 generates a file and t2 reads it. The problem is that my code tries to read the file before it gets generated. So, I want to start t2 after t1 finishes its job.

Can anyone give me a suggestion?

m00am
  • 5,404
  • 11
  • 53
  • 64
Ranjith
  • 1
  • 1
  • 4
    Post your code.. Then we can try to help – acruma Feb 28 '18 at 04:39
  • Welcome to StackOverflow! Please read the info about [how to ask a good question](https://stackoverflow.com/help/how-to-ask) and [how to give a reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). This will make it much easier for others to help you. – Aditi Feb 28 '18 at 04:45
  • Welcome to SO. As others have commented, please add your code to the question using the edit function. Without your code, we cannot give you any substantial answers, since we would need to do a lot of guessing. – m00am Feb 28 '18 at 10:14
  • How about using a Queue to do the producer and consumer logic. – Menglong Li Feb 28 '18 at 10:17
  • It seems that you want to perform a sequential job. So why do you want threads to begin with? – freakish Feb 28 '18 at 10:36

0 Answers0