Hi folks...
I am a bit new to the concept of threads.
I have a block of code that does various tasks and takes about 15 hours to complete - I need it to run 3 times - so total 45 hours to do whole thing - is there not a way to use 3 threads to run this block of code simultaneously?, bearing in mind the server the code will run on has 4 processors - it would be so cool to be able to allocate each processor each thread to run - thefore my total running time would be cut down dramatically...if you get my meaning.
However (having said all this) I suspect there is a problem if 2 or more threads are accessing the same variables code, am I right?, if so - I dont get the point of using threads?? Can anyone shed some light on this for me?
Cheers guys...
I am a bit new to the concept of threads.
I have a block of code that does various tasks and takes about 15 hours to complete - I need it to run 3 times - so total 45 hours to do whole thing - is there not a way to use 3 threads to run this block of code simultaneously?, bearing in mind the server the code will run on has 4 processors - it would be so cool to be able to allocate each processor each thread to run - thefore my total running time would be cut down dramatically...if you get my meaning.
However (having said all this) I suspect there is a problem if 2 or more threads are accessing the same variables code, am I right?, if so - I dont get the point of using threads?? Can anyone shed some light on this for me?
Cheers guys...