Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 C++ Multithreading
Index -> Programming, C++ -> C++ Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
mirhagk




PostPosted: Thu Jul 14, 2011 3:32 pm   Post subject: C++ Multithreading

Now I know a great deal about multithreading, and I even know how to use windows only multithreading with C++, however is there a way/is there a library that is actually cross platform for multi-threading? (I have found some that work on multiple platforms, but they are generally ones that work only on linux platforms. I have yet to come across one that works for linux (at least the major flavours), windows and OS X).

Also it seems to me that while C++ itself can be compiled on any operating system (well most), libraries are not at all cross-platform, so it looses all claims to cross-platform as soon as it actually does something useful lol.

If this is the case why do so many hate languages like C#.NET that are only for one system? The only advantage C++ carries over C#.NET is that it is slightly faster with certain programs (although if the programmer is smart enough there is no noticeable speed difference) it seems.
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Thu Jul 14, 2011 4:21 pm   Post subject: RE:C++ Multithreading

For all things, there is a Wikipedia article: http://en.wikipedia.org/wiki/List_of_C%2B%2B_multi-threading_libraries

I'd guess that Boost is the closest to what you're after, but fair warning: I've also heard that compiling Boost has driven developers to madness.

I think a lot of the hate for C# / .NET is because people see it -- correctly or incorrectly -- as another Microsoft ploy to engineer developer, user and software lock-in. They make something easy to work with, but cleverly do it without actually releasing any kind of standards document. Then, when other people try to work with those files, they arbitrarily modify the file formats, network formats or behaviour of the program to make it difficult to work with their software. This doesn't really make the experience better for their users, it just makes it worse for everyone else -- analogously, they use their weight to make sure you get flung off the seesaw, even though it doesn't make the seesaw any better for them.

They've done this repeatedly: DOS, Windows, Word, Excel, Java, Internet Explorer, VB, ...

Some of the hate probably comes from people not wanting to learn new things. C++ has worked just fine for them for years, so why change? It's a valid argument, but it also begets a lot of vitriol from both sides: one doesn't want to move to new, untested and unfamiliar technology, and the other doesn't want to use old, arcane and unfamiliar technology, so of course the logical solution is to call everyone names until you've lost your voice.

Other languages, like Java, get a lot of hate for a lot of other completely valid reasons (it's a relatively limited language, in terms of syntax and programming style), and some historical reasons (back in the day, Java was slow...on a good day).

I will agree though: cross-platform C++, even between UNIXy systems (Linux / Solaris / AIX / HP-UX / BSD / OSX), is a complete horror show. You're essentially compiling several totally different programs, and good luck proving they work the same way. Plus, you're fooling yourself if you think that compiler A and compiler B will ever agree on what a valid program looks like.
trintith




PostPosted: Thu Jul 14, 2011 8:03 pm   Post subject: RE:C++ Multithreading

I don't know if there are better options, but I've had a lot of luck with Qt, a cross-platform library. It offers a pretty convenient threading class (see http://doc.qt.nokia.com/latest/qthread.html and http://doc.qt.nokia.com/latest/threads.html). Slots and signals (a major feature of Qt) are an extremely convenient way of communicating across threads.
mirhagk




PostPosted: Fri Jul 15, 2011 12:41 am   Post subject: RE:C++ Multithreading

Thank you demonwasp, and I suspected that the hate of C#.NET was purely based off the fact that microsoft made it, and not for any valid reasons lol. Don't get me wrong, C++ is a great language, and definetly faster in tight loops and core functions, but C# is so damn convienient, and it provides standard libraries for anything that would be CPU intensive and even kind of common, so speed isn't an issue.

Generally I see each language of having it's place, C++ is definetly better for older systems that most businesses still use, and for compatibility with older libaries, while C# is useful for getting a program done quickly, easily, and cleanly, and Java beats anything in the cross platform market, being the definite choice if you want cross-platformness with no difficulty.

Thanks for the links, and thanks trintith for that suggestion, I'll check them out and see if there's any library that does not take 6 months to set up lol.
DemonWasp




PostPosted: Fri Jul 15, 2011 10:02 am   Post subject: RE:C++ Multithreading

Well, I wouldn't say "not for any valid reasons". Microsoft has worked incredibly hard to make life hell for other people, so... credit where credit is due: they earned their hate.
Display posts from previous:   
   Index -> Programming, C++ -> C++ Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: