LiveWire Network Peer Answers Peer Support Teen Forums Tech Forums College Forums 688 users online 168535 members 1371 active today Advertise Here Sign In
TeenCollegeTechPhotos | Quizzes | LiveSecret | Video | Dictionary | News | FAQ
You have 1 new message.
Emergency Help
Until you sign up you can't do much. Yes, it's free.

Sign Up Now
Membername:
Password:
Already have an account?
Invite Friends
Active Members
Groups
Contests
Moderators
4 online / 61 MPM
Fresh Topics
  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic

C++ Multithreading
Which API to use?
Replies: 4Last Post Dec. 27, 2007 9:55am by Stormblazer
Single page for this topic Email Print Favorite
( Stormblazer )


Visionary
Reply
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)?

-------
Religion: Apathetic agnostic
Political Affiliation: Independent


8:13 pm on Dec. 25, 2007 | Joined April 2005 | 252 Days Active
Join to learn more about Stormblazer Colorado, United States | Bi-curious Male | 5381 Posts | 8303 Points
Post from this position was omitted due to content violations
( Stormblazer )


Visionary
Reply
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?

-------
Religion: Apathetic agnostic
Political Affiliation: Independent


5:44 pm on Dec. 26, 2007 | Joined April 2005 | 252 Days Active
Join to learn more about Stormblazer Colorado, United States | Bi-curious Male | 5381 Posts | 8303 Points
Whuppee


Dairy Product Addict

Ad Free
Reply
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?

-------
Unbelievably awesomesauce to the absurd degree that I wet myself.
Who else has created a LW/magnets
so explicit the mods deleted a screencap of it? =P


4:06 am on Dec. 27, 2007 | Joined May 2002 | 361 Days Active
Join to learn more about Whuppee Oregon, United States | Lesbian Male | 1510 Posts | 7131 Points
( Stormblazer )


Visionary
Reply
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

Post edited at 9:55 am on Dec. 27, 2007 by Stormblazer

-------
Religion: Apathetic agnostic
Political Affiliation: Independent


9:55 am on Dec. 27, 2007 | Joined April 2005 | 252 Days Active
Join to learn more about Stormblazer Colorado, United States | Bi-curious Male | 5381 Posts | 8303 Points
Single page for this topic Email Print Favorite

Quick Reply

You are signed in as our guest.

Looking for something else?
 

  LiveWire / Technical Forums / Programming & Application Development / Viewing Topic