Can anyone tell me how to convert this piece of code into a multi threading application.
I want a new (windows) thread for each client object. (each client objects also creates a player object, this player object belongs to the same thread)
Why don't you study up on multithreaded programming instead of asking others to write the code for you?
This is at least as bad as "Hi, here's my code, fix it please!"
Even if someone were to write this for you, if you don't understand the principles of multithreading and the consequences behind a multithreaded approach you won't be able to maintain or even understand the code provided
EDIT:
I may be a bit harsh here, but my point stands. Try something by yourself before going to the forums, there's a wealth of information which you could've studied online. You could've at least tried to use the threading library provided by windows, or boost, or whatever to make your app multithreaded by yourself
Radikalizm wrote:Why don't you study up on multithreaded programming instead of asking others to write the code for you?
This is at least as bad as "Hi, here's my code, fix it please!"
Even if someone were to write this for you, if you don't understand the principles of multithreading and the consequences behind a multithreaded approach you won't be able to maintain or even understand the code provided
EDIT:
I may be a bit harsh here, but my point stands. Try something by yourself before going to the forums, there's a wealth of information which you could've studied online. You could've at least tried to use the threading library provided by windows, or boost, or whatever to make your app multithreaded by yourself
You could atleast give me some good links... I understand the basics of multithreading, I just can't figure how to convert this code.
Before 'while (true)' you create four threads and you send them to a function like
threadfn(int tid)
{
while (true)
Client[tid]->update(counter++);
}
But this has nothing to do with Irrlicht. And if you intend to use Irrlicht you have to appreciate that Irrlicht is a rendering engine and (so) it is single-threaded.
mongoose7 wrote:Before 'while (true)' you create four threads and you send them to a function like
But this has nothing to do with Irrlicht. And if you intend to use Irrlicht you have to appreciate that Irrlicht is a rendering engine and (so) it is single-threaded.
I am allowed to post general programming questions here.