Re: [linux-audio-dev] Multithreaded programming for a poll model?

New Message Reply About this list Date view Thread view Subject view Author view Other groups

Subject: Re: [linux-audio-dev] Multithreaded programming for a poll model?
From: Paul Davis (paul_AT_linuxaudiosystems.com)
Date: Fri Jun 18 2004 - 02:23:00 EEST


>and don't care if the signal is lost. Is there any advantage to
>calling trylock() before doing that, or is signalling on a condition
>you have no mutex interest in an OK thing to do?

the semantics of condition_wait/condition_signal require that

    IF condition_wait() has been called AND condition_signal() is
    called THEN the waiter will wake up

you cannot satisfy these semantics without the mutex, as tim
demonstrated. if you want some other semantics, maybe you can get by
without it. i know i've been bitten by race conditions caused by
trying to do this several times, and they are hard to track down and
identify. i also don't use conditions for RT stuff - they are not RT
safe. currently, i use FIFO's, and i plan to switch to futexes when
they become available. NPTL uses futexes to implement condition
variables, but linuxthreads uses signals.

--p


New Message Reply About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b28 : Fri Jun 18 2004 - 02:21:21 EEST