Home » Community » Newbie corner » Multi-Threading newbie questions
Multi-Threading newbie questions [message #37902] |
Wed, 21 November 2012 11:55  |
navi
Messages: 107 Registered: February 2012 Location: Sydney, Australia
|
Experienced Member |
|
|
I have checked the Example, Bazzar and have search the Forum for a beginner’s guide/example for Multi-Threading/CoWork
I found the followings CoWork, GuiMT, GuiLock and few other MT Server examples. I am still as confused as when I started with this topic. Is there an easy example or beginner’s guide exist for how to Multi-Thread anywhere?
What I am trying to achieve is the following:
I have 2 Vectors in my MainWindow Class. I am trying to Create a WorkerFunction(Vector<String>& a, Vector<String>& b) which will copy Vector ‘a’ into Vector ‘b’ element by element and also need to notify the MainWindow about its progress i.e how many element has currently been copied. How do I create the thread? Should I use Thread() or CoWork? what would happen if while the Worker is running and the user closed the MainWindow?
Thanks & Regards
Navi
[Updated on: Wed, 21 November 2012 12:00] Report message to a moderator
|
|
|
|
|
Re: Multi-Threading newbie questions [message #38205 is a reply to message #38202] |
Thu, 06 December 2012 01:06  |
navi
Messages: 107 Registered: February 2012 Location: Sydney, Australia
|
Experienced Member |
|
|
281264 wrote on Wed, 05 December 2012 22:34 | navi,
Time ago I prepared this example, just to practice; it may be of help.
Javier
|
Hi Javier,
Thanks for uploading your example. I have gone through your practice thread app. Thanks it was quite simple and easy. I learned that we can directly call EnterGuiMutex();LeaveGuiMutex(); for setting up GUI lock instead of using GuiLock objects. I prefer you style as it more explicit and not based on scope like GuiLock;
regards,
Navi
|
|
|
Goto Forum:
Current Time: Tue Apr 29 05:48:11 CEST 2025
Total time taken to generate the page: 0.00566 seconds
|