All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pedro Gonnet <gonnet@maths.ox.ac.uk>
To: pmorreale@novell.com
Cc: dmarkh@cfl.rr.com, linux-rt-users@vger.kernel.org
Subject: Re: Question regarding pthread_cond_wait/pthread_cond_signal latencies
Date: Sun, 22 May 2011 12:34:22 +0100	[thread overview]
Message-ID: <1306064062.10494.42.camel@laika> (raw)
In-Reply-To: <1306025059.2169.16.camel@hermosa.morreale.net>

On Sat, 2011-05-21 at 18:44 -0600, Peter W. Morreale wrote:
> Do you use any pthread* primitives involving scheduling?  

I'm not quite sure what you mean by scheduling functions... I only use
the basic pthread_mutex_* and pthread_cond_* functions.

> How do you start your process?  How many threads?  What else is on the
> machine? 

The main thread starts several threads with pthread_create. I have a
barrier which uses pthread_mutex's and pthead_cond's to synchronize the
threads. This is where the delays happen.

I observed these latencies both on my own laptop (loads of stuff running
in the background) and on multi-core servers on which I was alone. 

I should probably note that I also use OpenMP for some simple
parallelization as well. Eg. after releasing the threads and waiting for
them all to return to the barrier, some things are computed with OpenMP
(OMP_WAIT_POLICY=PASSIVE).

The kernels on which I have seen this are the Ubuntu -generic kernels
2.6.31--2.3.35. I have also tried running the simulations on a Ubuntu
2.6.31-11-rt kernel. This, however, caused the whole simulation to run
twice as slow, even when only using one single thread (on a 6-core
machine).

Please do let me know if you need any more specific information!

Cheers, Pedro




  reply	other threads:[~2011-05-22 11:34 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-20 10:08 Question regarding pthread_cond_wait/pthread_cond_signal latencies Pedro Gonnet
2011-05-21 20:48 ` Mark Hounschell
2011-05-21 20:51   ` Pedro Gonnet
2011-05-21 21:40     ` Rolando Martins
2011-05-22  0:44     ` Peter W. Morreale
2011-05-22 11:34       ` Pedro Gonnet [this message]
2011-05-22 13:51         ` Peter W. Morreale
2011-05-22 18:37 ` Robert Schwebel
2011-05-20 11:15 Pedro Gonnet
2011-05-22 14:53 ` Armin Steinhoff
2011-05-22 15:18   ` Armin Steinhoff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1306064062.10494.42.camel@laika \
    --to=gonnet@maths.ox.ac.uk \
    --cc=dmarkh@cfl.rr.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=pmorreale@novell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.