All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] [Posix] I/O multiplexing with select
@ 2013-05-08 13:53 alex alex
  2013-05-08 14:19 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 23+ messages in thread
From: alex alex @ 2013-05-08 13:53 UTC (permalink / raw)
  To: Xenomai

xenomai = 2.6.2.1
linux kernel = 3.5.7
arch = x86

Hello everyone,

I'm working on a program that uses both a TCP with linux socket and a
real-time communication module based on rtnet using rtdm.
My requirement is to use the select function with this 2 types of
communication.
To make this works, I created a wrap on select that is calling a function ("
wrap_select") to create two threads in detached mode: the first for linux
descriptors and the second for rtdm descriptors.
After the creation of threads, the "wrap_select" function that waits
for a semaphore.
This semaphore is posted by the thread which select is released.
Then the function "wrap_select" destroy the two functions with
pthread_cancel.

This mechanisme works fine but after a certain number of calls, creating
thread with pthread_create fails with the following error: errno = EAGAIN,
Insufficient memory exists in the system heap to create a new thread,
Increase.
It seems there was a limit to the thread creation...

1 - Have you any idea about how to work around this problem?

2 - A solution would be to create two threads to handle rtdm select and
linux without destroying them each time.
But in this case I have to report to the select which thread is still blocking
its release and I dont know how I can do that.

3- Maybe there is a better solution or maybe this problem has already been
encountered and solved by one of you?

Regards,

Alexandre

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

end of thread, other threads:[~2013-05-11 13:11 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-08 13:53 [Xenomai] [Posix] I/O multiplexing with select alex alex
2013-05-08 14:19 ` Gilles Chanteperdrix
2013-05-08 20:34   ` alex alex
2013-05-08 20:49     ` Gilles Chanteperdrix
2013-05-08 21:30       ` alex alex
2013-05-09  9:30         ` alex alex
2013-05-09 11:45         ` Gilles Chanteperdrix
2013-05-09 13:13           ` alex alex
2013-05-09 13:26             ` Gilles Chanteperdrix
2013-05-09 14:09               ` alex alex
2013-05-09 14:14                 ` Gilles Chanteperdrix
     [not found]                   ` <CAPpP=rMLPeRAVCpdKQkLVD29pFUj8zPL5JRmTbrJkKEetJJbew@mail.gmail.com>
2013-05-09 14:51                     ` alex alex
2013-05-09 14:54                       ` Gilles Chanteperdrix
     [not found]                         ` <CAPpP=rNFf4qH0JPpR57i5qp1tmHbLb2k8X9qYjn+6dmZb_ckvA@mail.gmail.com>
     [not found]                           ` <518BBFDC.7060102@xenomai.org>
2013-05-09 15:35                             ` alex alex
2013-05-09 15:37                               ` Gilles Chanteperdrix
2013-05-09 15:46                                 ` alex alex
2013-05-09 15:49                                   ` Gilles Chanteperdrix
     [not found]                                     ` <CAPpP=rPFd3h_aTBKoL6bUwAqbLT5yDp0G057h1PssUo8MVKxDg@mail.gmail.com>
     [not found]                                       ` <518BCB6B.5070908@xenomai.org>
     [not found]                                         ` <CAPpP=rNs37xZRsJRd3JvS4Pf16jhRWmxsS+Y6gVR=R9RQ6SWjQ@mail.gmail.com>
     [not found]                                           ` <518BCD6C.8060501@xenomai.org>
     [not found]                                             ` <CAPpP=rODvDuVjP+CfE=6jYTRP5nD5smumnAV3mj51YQm8mzw0Q@mail.gmail.com>
2013-05-09 16:44                                               ` alex alex
2013-05-09 16:45                                                 ` Gilles Chanteperdrix
2013-05-09 16:56                                                   ` alex alex
2013-05-09 17:15                                                     ` Gilles Chanteperdrix
2013-05-09 17:52                                                     ` Gilles Chanteperdrix
2013-05-11 13:11                                                       ` alex alex

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.