many potatersssss

Started by
19 comments, last by RoundPotato 10 years, 7 months ago


Advertisement

If you can't figure out how to get boost to work, consider upgrading your compiler. Threading support is now part of the standard library as of C++11. std::thread is largely based on boost::thread and will work out of the box with a C++11 compiler.


I need threads in my program

I'm curious. Why?

Since you are posting in For Beginners, I would suggest that even if you want to add it, you should not add multithreading to your game. It is extremely unlikely that whatever you are developing actually needs multithreaded algorithms.

Multithreading is hard. Debugging in a multithreaded environment is very hard. When you are just learning to write games adding multithreading is just one more thing added to the long list of things you need to learn. Becoming a game developer is hard enough with single-threaded games.


from what I know/read/seen Boost Threads are the best ?

They might be. It depends on your situation.


I tested it under dev-c++

Dev-C++ is long dead, a quick search shows the last update was in 2005 and that there are several hundred known major bugs.

There are many free alternatives out there. Visual C++ Express Edition, Code::Blocks, clang, and more. These are current compilers that are maintained and support the updates to the c++ language.

All of those compilers support threading out of the box since the new C++ standard includes a threading library.


It appears I need to compile/build them. The documentation is as weird as a round carrot ... It's like blinking an eye and an obvious thing for those who work with them, yet to a beginner like me it's a rock wall. Please help me drill that wall down

These are signs that you are probably not ready for multithreading. Adding externally-built libraries to your program is a small thing relative to the difficulty of writing multithreaded code.

Eventually you will be ready for that kind of features. I recommend against them for now.


 

Again, C++11's std::thread is based on boost::thread. The feature set is almost the same.


 

gcc is available on linux and has had support for C++11 since gcc 4.7.


 

No offence/disrespect on the following sentence meant(please): Yeah multi-threading is very scary....it's like an Armageddon... well, no, not really.
Obviously I not only need them as common sense but I also need them at the moment for server side to listen and deal with multiple connections.

Thing is, you can put "no disrespect" on anything you like but from what I'm reading you seem very set on the idea that you know better than everyone here so I'm not entirely sure why you're even asking.

Threading for sockets is a legitimate practice but you can certainly do networking without needing multiple threads, there are non-blocking sockets for this reason.

The most flexible and low on resources implementation there is as well as most used, supported, proven, etc. etc. You know, the usual.

There's no "usual" in programming, what is good in one situation isn't good in another. The fact you don't seem to know that is rather scary. People have already mentioned that the C++ threading code is almost identical to the boost one so obviously it would be preferable to use the C++ standard library version unless you have either good reason to use the boost one or do not have access to it on your compiler.

I'm afraid you are wrong, please see http://orwelldevcpp.blogspot.com/ .

C++11 is a relatively new "thing" and as I mentioned I was advised that Boost Threads are more "powerful" or "flexible".

I wouldn't call a fork of an IDE to be the same as the original IDE, in fact if its a fork it shouldn't be using the same name in general.

What cracks me up in general is that you're so interested in having the "perfect" or "most optimal" library for a situation you don't even seem to be able to adequately explain, and ontop of that you're using an ide/compiler that I can almost guarentee does not have the same support or quality as half of what SiCrane just listed.

Visual studio doesn't even support all of C++11 yet and I believe gcc is still missing some as well, so it's not exactly unrealistic to think a fork of a long dead program might not support something like the new threading.

Not trying to be rude or anything here, just giving you a reality check. You're coming off more as trying to tell everyone they're wrong than to ask why they suggest what they do.

At the time of writing this, clang implements all of c++11.

This topic is closed to new replies.

Advertisement