 Let's build upon the last example. We're going to do something very similar, but we want to actually control the order in which things are processed Let's go in here Let's be sure to add the Concurrent save that Give it a good build. Just make sure everything works as expected and we got a few includes here Q to bug. All right, you guessed it from the includes. We're going to be working with concurrent thread and thread pool Once again, I'm going to put in some notes just in case somebody skips the tutorial and goes right to get hub All right, so we're going to make a loop We're going to give it the ever descriptive name loop here and Really all this is going to do is well loop Chalker, I know And we're going to say I is less than 10 so the reason why we're looping is we want to show that this is actually running on a specific thread We're just going to say loop Well the iteration Yeah, we want to know what thread we're currently running on here Now let's make a test function and we're going to well call our loop function So basically what we're going to do here is we've got our loop function Which does absolutely nothing other than loop and tell us where we're looping and we've got a test function Which is calling loop We're going to call Loop directly and we're going to call test but we're going to call this on a different thread And we're going to see just how easy that is with the Q concurrent name space here So let's go ahead and do a Q thread and we want to set the object name and we're going to set this to main Just so we know what our main thread is Let's go ahead and get the thread pool and we want the Q future And Q future is typed or I should say templated so we're going to say void Q concurrent namespace and we want to call run and you see there is a whole lot of Parameters that we can add in there. All right, so we're going to give it a reference to pool And we're going to tell it to call test So what is really going on there? Well Basically what we're saying is we're going to make a thread pool Pool and we're going to say run on the pool this function this guy right here And all this is going to do is call loop. Let's see Current thread there we go Now let's call loop directly and see what happens here. All right, so Just kind of in review here. We've got our current thread. We got a thread pool We're going to call concurrent run. We're going to use the thread pool to call the test function Which is of course calling loop, but then we're also calling loop here If you think of this in terms of threads and execution, it's actually pretty straightforward Basically, this is our main thread This right here Tells it to spin off and run and run on a thread pool Save and run You can see it did exactly what we thought it was going to do Main is called on the main thread test is called on the pool thread and then of course We have loop zero on main loop zero on pooled One one two two. So what we're really showing is we're running this loop function Twice once on the main thread and once in the thread pool and this is doing it. Well You guessed it asynchronously meaning we don't have to mess around with any mutexes Weight locks anything like that. We haven't really done anything that would modify the data anyways, but it's just showing that Running something on a thread pool is ridiculously simple Let's just face it cute is extremely complex and has a massive learning curve But once you learn it you can do just about anything Unfortunately learning cute is a challenge in itself and if you've tried learning straight from the docs You've probably become easily frustrated while they do a really good job They're arguably some of the best documentation in the world They don't go that extra step and leave a lot of people guessing what to do How do all these things interconnect? That's why I started developing videos. I've done videos not just on my own YouTube channel Which you're watching now, but also on the official cute studios channel and I've started doing video courses out on you to me calm Right now. I have the cute core series. It covers beginners intermediate advanced So it'll take you straight from hello world all the way up to building a complex multi-threaded encrypted TCP server on Top of that if you don't want any of this you can still join the void rooms Facebook group Which has a pretty flourishing group of developers and we discuss everything not just cute. I hope to see you there