linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Looking for a real time IPC to be used with select
@ 2010-04-16 14:12 M. Koehrer
  2010-04-16 20:30 ` Leyendecker, Robert
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: M. Koehrer @ 2010-04-16 14:12 UTC (permalink / raw)
  To: linux-rt-users

Hi all,

I have a real time application with a couple of threads.
One thread is waiting on a select() call (with timeout)
for data coming in from a UDP Ethernet socket.
Once it gets data it does some computation and finally 
leads to the writing of data on the UDP socket.

The (simplified) code for this real time thread is:

void *thread_func_A(void *arg)
{
  while (1)
  {
     rc = select(...); // Read socket with timeout_value);
     if (rc > 0)
     {
        recv(.., data, .. ); // recv data from socket
        compute(data, data2);       // Compute data and modify them to data2
        send(..., data2, ...); // Send data2 to socket
     }
   }
}

This works fine.

Now I have the need that another real time thread B should also be able
to trigger the "select()" in the thread_func_A() above.
This means, I should add a suitable inter-process-communication
between thread A and B that can be used with select() as well.
Having this, the thread A can be triggered by the socket or
by the IPC from thread B by adding two file desciptors to the readfds
of select().

My question is now: What kind of IPC is preferred here?
The only IPC I see is a local socket communication, however
this looks like a huge overhead for triggering...

Both, threads A and B are real time threads, thus any IPC in use
should be supported by the RT_PREEMPT patch.

Setup: PC (Core2Quad, kernel 2.6.31.2-rt13)

Thanks for any feedback on this question.

Regards

Mathias



-- 
Mathias Koehrer
mathias_koehrer@arcor.de


Traumziele - von Beschreibung bis Buchung jetzt kompakt auf den Reise-Seiten von Arcor.de! http://www.arcor.de/rd/footer.reise

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-19  6:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-16 14:12 Looking for a real time IPC to be used with select M. Koehrer
2010-04-16 20:30 ` Leyendecker, Robert
2010-04-17  7:55 ` Armin Steinhoff
2010-04-17 14:42 ` Pradyumna Sampath
2010-04-18  4:43 ` Sujit K M
2010-04-19  6:24 ` M. Koehrer
2010-04-19  6:31 ` M. Koehrer

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).