EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

<20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: POSIX recursive mutex
From: Marty Kraimer <[email protected]>
To: Jeff Hill <[email protected]>, "Johnson, Andrew N." <[email protected]>, [email protected]
Date: Mon, 02 Dec 2002 15:26:46 -0600
A problem using pthread_mutex to implement epicsMutex is that pthreads does not provide a pthread_mutex_lock with a timeout. Thus the only way I see to implement epicsMutexLockWithTimeout is to do something like

timeleft = timeout;
while(timeleft>0.0) {
    if(pthread_mutex_trylock(...)==success) break;
    epicsThreadSleep(shortTime);
    timeleft -= shortTime;
}

I am not bsure this is a good idea. What do you think?

Marty


Replies:
RE: POSIX recursive mutex Jeff Hill

Navigate by Date:
Prev: RE: 3.14 Gateway Performance Kenneth Evans, Jr.
Next: RE: POSIX recursive mutex Jeff Hill
Index: <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: R3.15 and dbd files Andrew Johnson
Next: RE: POSIX recursive mutex Jeff Hill
Index: <20022003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·