Hello, in this python programming video, we are going to synchronize our threads. So one of the things we are going to do is get rid of the exit flag we won't need that. So this name counter not so good Fred and Fred in itself. Now, all of this method is fine. We're all good with that. In the one method, we are going to change slowly, that is fine.
We're still only calling it like so. We just need to do this square. Block, acquire. And then we need to be at the end of word. Like so. And now the tone function is gonna slightly change.
We don't have the exit flag and So look so that the counter you know, we're happy with that we got the we don't need the exit method and more than that and the way and everything else is all good to go. So let's keep going down here we need to create a thread lock so we're going to do thread lock look like so luck equals gnosis so this is just going to be our essentially our, our array that we'll be adding our friends to know when our assigned irate list very similar to arrays and here we or creating the thread which this isn't changing the font. So start in the threads. But the difference is we're not joining them and they're not exactly like this, what we'll do is we'll actually add to the list of created. Copy that referred to. And now we need to go for every Fred.
We're going to wait for all the threads to complete. So this is a more dynamic way. If we had 20 threads, we wouldn't have to have as much code as we did before it's more efficient. So again, that's what we've all been building up towards. And what it says forget any errors, no errors for the threads are running and the working so which is test And they have now finished. So that's it for this tutorial.
We synchronized the threads and for watching and I look forward to seeing you in the next awesome python programming video.