Connecting Tech Pros Worldwide Help | Site Map

Multithreading

Member
 
Join Date: Mar 2007
Posts: 110
#1: Sep 23 '09
What do you preferred for multithreading? .NET or C++?

i am doing a report on the caveats/advantages; any platforms for comparison? ideas? comments?
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#2: Sep 24 '09

re: Multithreading


I honestly think threads are easier to understand in c++ then in .NET
Closing threads threads seems to be easier in c++ too. I guess I dislike how often I do my threads wrong in .NET and they stay open after my program closes
Member
 
Join Date: Mar 2007
Posts: 110
#3: Sep 24 '09

re: Multithreading


interesting. invaluable personal opinion/experience...thanks

any specific links on the internet regarding c++?
Newbie
 
Join Date: Sep 2009
Posts: 2
#4: Sep 24 '09

re: Multithreading


My topics are always close when i close application(FormClosing event and Thread.Abort) if that dont help GetCurrentProcess.Exit(). Threads in .NET are easy
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#5: Sep 24 '09

re: Multithreading


Easy to setup yes, but if they're doing IO and are "busy" they won't always exit.
I started insterting things into the Disposing() function of the form to deal with it better.
Member
 
Join Date: Mar 2007
Posts: 110
#6: Sep 24 '09

re: Multithreading


Quote:

Originally Posted by Plater View Post

Easy to setup yes, but if they're doing IO and are "busy" they won't always exit.
I started insterting things into the Disposing() function of the form to deal with it better.

for specifically that, you can use threadName.Join()

it will stop the calling the thread till threadName finishes execution...obviously standard warnings about threads apply
Plater's Avatar
Moderator
 
Join Date: Apr 2007
Location: New England
Posts: 7,148
#7: Sep 24 '09

re: Multithreading


Hmm I am starting to like the form.closing sugestion.
There have been times when the delegate callback for the thread (so that it can update the gui) throws exceptions because it has fired the callback after the form has disposed of its controls.
Interesting.
Reply