Hi Andrew, Eric
I'll try that. If we're talking API changes I'd like to suggest priority message support, adding at the head instead of the tail like vxWorks msgQSend MSG_PRI_URGENT. I find it useful for timer messages. epicsMessageQueueSendPriority?
James
> -----Original Message-----
> From: Andrew Johnson [mailto:[email protected]]
> Sent: 28 January 2011 17:30
> To: Rowland, James (DLSLtd,RAL,DIA)
> Cc: EPICS tech-talk
> Subject: Re: epicsMessageQueue Linux PREEMPT_RT
>
> Hi James,
>
> On Friday 28 January 2011 10:16:45 you wrote:
> >
> > The PREEMPT_RT patch makes the kernel fully pre-emptive (leading to
> > improved maximum latency) and adds support for priority inheritance
> > mutexes. There are no user space API changes, the code to use
> > _POSIX_THREAD_PRIORITY_SCHEDULING and _POSIX_THREAD_PRIO_INHERIT is
> > already in libCom (if disabled by default). I'd like to use the
> > epicsMessageQueue from a high priority thread but the send and
> receive
> > functions may calloc an eventNode, and that might cause a page fault
> or
> > block my thread on the malloc lock. I'd like to be able to pre-
> allocate
> > the eventNodes because I know the maximum number of threads that may
> > wait on the queue in advance.
>
> Thanks; after looking at the code I see that could be tricky. However
> it
> looks like if you could arrange for all your reading threads to wait
> for a
> message at startup (with the queue empty) they will each call
> getEventNode()
> and hence allocate the necessary number of eventNode objects. After
> they're
> all waiting on the queue you would release them all by sending the
> requisite
> number of messages through the queue from the initializing thread. I
> think
> that should work with the existing API, but I've not actually tried it.
>
> We probably should add a routine to the API to allow the eventFreeList
> to be
> pre-allocated, but you probably want to be able to run on existing
> versions of
> Base.
>
> Eric — unless you stole the code from someone else you were the author
> of all
> the *MessageQueue.* files, 'bzr log' does not lie...
>
> - Andrew
> --
> If a man is offered a fact which goes against his instincts, he will
> scrutinize it closely, and unless the evidence is overwhelming, he will
> refuse to believe it. If, on the other hand, he is offered something
> which affords a reason for acting in accordance to his instincts, he
> will accept it even on the slightest evidence. -- Bertrand Russell
- References:
- epicsMessageQueue Linux PREEMPT_RT james.rowland
- Re: epicsMessageQueue Linux PREEMPT_RT Andrew Johnson
- RE: epicsMessageQueue Linux PREEMPT_RT james.rowland
- Re: epicsMessageQueue Linux PREEMPT_RT Andrew Johnson
- Navigate by Date:
- Prev:
Re: ca_create_channel memory management Andrew Johnson
- Next:
Re: ca_create_channel memory management pthomas
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
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: epicsMessageQueue Linux PREEMPT_RT Andrew Johnson
- Next:
Re: epicsMessageQueue Linux PREEMPT_RT Till Straumann
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
<2011>
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|