|
-
December 12th, 2012, 09:57 PM
#3
Re: Multi threading issue joining threads
 Originally Posted by Igor Vartanov
 Originally Posted by troutguy
Any comments?
Only one: Wrong forum.
... and another (rather) short one (sorry, I know it's off-topic here...):
Thread::Join() is a blocking operation, i.e. it doesn't return until the worker function of the respective thread itself has returned. So your shutdown loop may easily cause a deadlock if there are any synchronization inter-dependencies between the individual worker threads.
Also, it's not clear what class startTheServer() is a member of, IOW what this represents inside this function. However, the presence of the setText() member suggests it's some sort of GUI object or at least manipulates one. You need to be aware that in a Windows Forms app GUI manipulations are only allowed to be made by the GUI thread (IOW the application's main thread). Failure to observe this rule may lead to all sorts of weird (i.e. undefined) behaviour, including your program seemingly working without problems, leading to a false sense of safety.
BTW, the correct forum section for C++/CLI questions like this one is: http://forums.codeguru.com/forumdisp...ed-C-and-C-CLI
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|