From: Rolando Martins <rolando.martins@gmail.com>
To: Pedro Gonnet <gonnet@maths.ox.ac.uk>
Cc: dmarkh@cfl.rr.com, linux-rt-users@vger.kernel.org
Subject: Re: Question regarding pthread_cond_wait/pthread_cond_signal latencies
Date: Sat, 21 May 2011 22:40:27 +0100 [thread overview]
Message-ID: <BANLkTimKKohnaUU8fEp+kaB9Trpu8JBvTg@mail.gmail.com> (raw)
In-Reply-To: <1306011102.10494.34.camel@laika>
Hi guys,
I am building a real-time middleware and have also struggled with
similar behavior, at this point I reduced to the bare minimum the use
of condition variables.
(using 33-rt)
Rolando
On Sat, May 21, 2011 at 9:51 PM, Pedro Gonnet <gonnet@maths.ox.ac.uk> wrote:
> On Sat, 2011-05-21 at 16:48 -0400, Mark Hounschell wrote:
>> On 05/20/2011 06:08 AM, Pedro Gonnet wrote:
>> >
>> > Hi guys,
>> >
>> > I'm currently working on a shared-memory parallel Molecular Dynamics
>> > simulation library (http://mdcore.sourceforge.net/) geared towards
>> > multi-core systems.
>> >
>> > The library uses pthreads (plus some OpenMP for some simple loops) and
>> > uses pthread_cond_wait and pthread_cond_signal to coordinate a group of
>> > worker threads.
>> >
>> > I've been profiling the library on different machines and kernels and
>> > have noticed that in many cases there are significant (several ms,
>> > measured with Intel's Vtune-thing) lags between calls to
>> > pthread_cond_signal and the waiting thread actually getting back to
>> > work.
>> >
>> > I've tried the Ubuntu -rt and -preempt kernels, and the whole simulation
>> > runs twice as slowly, despite following the advice given here:
>> >
>> > https://rt.wiki.kernel.org/index.php/HOWTO:_Build_an_RT-application
>> >
>> > My question is the following: which kernel (or set of configuration
>> > options) will minimize these latencies? And if linux-rt is the answer,
>> > in what ways do I have to be careful when porting the simulation for
>> > this kernel?
>> >
>>
>> Are you saying several ms latency from pthread_cond_signal to waking up a
>> thread in pthread_cond_wait?
>>
>
> Yes. Or at least, this is what Vtune says. It could also be a fluke in
> Vtune, but I would still be interested in knowing what kernel or what
> kernel options can make these operations as fast as possible.
>
> Cheers, Pedro
>
>
>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-05-21 21:40 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 [this message]
2011-05-22 0:44 ` Peter W. Morreale
2011-05-22 11:34 ` Pedro Gonnet
2011-05-22 13:51 ` Peter W. Morreale
2011-05-22 18:37 ` Robert Schwebel
-- strict thread matches above, loose matches on Subject: below --
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=BANLkTimKKohnaUU8fEp+kaB9Trpu8JBvTg@mail.gmail.com \
--to=rolando.martins@gmail.com \
--cc=dmarkh@cfl.rr.com \
--cc=gonnet@maths.ox.ac.uk \
--cc=linux-rt-users@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).