On Thu, Oct 23, 2008 at 19:52, Ioannis Papadopoulos
<[EMAIL PROTECTED]> wrote:
> Well, I'm working all the time with pthreads, OpenMP and MPI. I'm also
> familiar with Intel's TBB. The all have their pros and cons - and I'm
> only talking for shared-memory applications, as a distributed memory
> implementation would have too much latency (people have been using MPI
> even for applications on shared-memory machines with mixed results).
>
> I was thinking about pthreads, but the problem is:
> 1) there is no portable way of supporting atomic operations (OpenMP has
> a directive for that). Moreover, you have to maintain coherency and
> avoid race-conditions using the volatile keyword and locks. In OpenMP
> all this is done by the compiler.

Well, pthreads are not intended to handle atomic operations, that's
what semaphores are for.

> 2) one has to implement the scheduling and task management (OpenMP does
> that already and OpenMP 3.0 which is around the corner will support that
> even better - there is already a nearly done branch for v3.0)

Pthreads don't need to be scheduled by hand either, the OS does it.

> 3) OpenMP is easy even for beginners in parallel processing
> 4) you can always remove OpenMP by telling the compiler that you don't
> want support (ok, even for pthreads you can do that, but manually)
>

Well, in my experience, OpenMP also has a number of disadvantages.
Granted it is very easy to write your first parallel program with it,
but it is also extremely fragile, because the parallel semantics can
be left implicit (which in my experience leads to a high number of
bugs that are difficult to find). Basically, once you tackle bigger
programs, you end up adding a lot of shared/private statements
everywhere, which becomes untractable inside big codes like mesa.

> On the other hand pthreads allow you to micromanage everything - what to
> execute where etc. thus maybe you can achieve optimal parallelism.
>

Well, in the mesa case I don't think OpenMP would have much added
value over other techniques - the parallel section would just be the
rasterization phase, so the choice of the API doesn't matter much as
it's not much work in itself. The real work would be making the
rasterizer {pthread,OpenMP,MPI} safe...

Stephane

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to