|
-- Posted by Stormblazer at 8:13 pm on Dec. 25, 2007
I've begun looking into multithreading APIs recently, most for a fractal generator program I've built. Most of the traditional implementations I've found are a royal pain in the ass just to start with, and worse, they typically can't be used properly with object-oriented mechanics. So I eventually narrowed it down to Boost's Thread library and OpenMP. Well, Boost has no usable instructions for how to build it on a windows machine with MinGW, and OpenMP has been a nightmare trying to find a working compiler for it. Apparently only the latest versions of GCC have OpenMP support despite various commercial compilers having had support for it for years. So I pulled up a 4.2 implementation of MinGW. Well, it understands OpenMP #pragma directives, and it came with the gomp library (a GNU implementation of OpenMP), but no header file, which is useless, and I still can't find the header file anywhere. So... anyone know how to build Boost for MinGW (GCC on windows) or use OpenMP properly on MingGW (GCC)?
-- Posted by Stormblazer at 5:44 pm on Dec. 26, 2007
Ok, I've had some more luck with MinGW, but I still can't get MinGW 4.2 to work with Dev-Cpp. I tried installing GCC 4.2 on cygwin, only to find that the latest version of GCC on cygwin is 3.4... GCC 4's been out for awhile now, what gives? Anyone have tips?
-- Posted by Whuppee at 4:06 am on Dec. 27, 2007
Might as well start by saying: I have no idea. And that tends to mean that you'll not find anyone else on here capable of answering. My experience with C++ is rather limited, though I do understand and have some experience with threading. I'll understand if my saying as much precludes any response =P That said, this actually isn't intended as a useless reply.. however much it may seem or prove to be. You mentioned OpenMP working on various commercial compilers for years. I'm assuming you don't have a license for one of those compilers, resulting in the lack of (older versions of) GCC support being a problem? And though I'll be attempting to look into the Boost and OpenMP libraries, I am curious: What other implementations have you looked at? How do you mean that they can't be used properly with object-oriented mechanics? (read: what are you looking for?) And finally, given the results of my latest google searches and your post.. am I to understand that C++ doesn't have any core support for threading?
-- Posted by Stormblazer at 9:55 am on Dec. 27, 2007
Quote: from Whuppee at 5:06 am on Dec. 27, 2007
And finally, given the results of my latest google searches and your post.. am I to understand that C++ doesn't have any core support for threading?
Yes. C++ has no built-in threading support, on purpose apparently. That said, I did manage to get OpenMP working with GCC last night finally, I'm not sure what the problem was to be honest. Unfortunately, it's proving very unstable, so it's not going to work either. I mainly want threading for use in a fractal generator I'm working on, it doesn't need a gui or anything, it's just a program for myself to explore and render fractals with, and mulithreading would significantly increase my speeds since I'm on a dual-core (and my new PC in february will have a quad-core), not to mention just knowing how to multithread. The problem with the windows api multithreading is that I don't know much about the windows api, and it looks like a mess. pthreads is the posix version of that, and while it's definitely cleaner and I'd prefer it, it's still messy to use in C++. Ideally I'd like to be able to abstract threads as objects- that is, an object that represents a thread. What little I've found on doing this doesn't make any sense -_- Edit: I can't seem to find a precompiled version of boost for mingw either
|