All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: alex alex <duch.alexandre@gmail.com>
Cc: Xenomai <xenomai@xenomai.org>
Subject: Re: [Xenomai] [Posix] I/O multiplexing with select
Date: Wed, 08 May 2013 22:49:01 +0200	[thread overview]
Message-ID: <518ABA3D.5070106@xenomai.org> (raw)
In-Reply-To: <CAPpP=rNt32NFsF5LhJybpcBRfm33za8kP2tQj+t4Vs9-hkH48w@mail.gmail.com>

On 05/08/2013 10:34 PM, alex alex wrote:

>> You do not want to work around the problem, you want to fix it. There
>> is probably some bit missing somewhere to get the thread control block
>> destroyed when a detached thread dies.
> 
> Yes, one variable was not freed...
> 
>> Yes, I have already done that, and tried and describe it in the
>> following text:
>>
>> http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#I.2FO_>multiplexing_with_select<http://www.xenomai.org/index.php/Porting_POSIX_applications_to_Xenomai#I.2FO_multiplexing_with_select>
>>
>> The posix binding for Xenomai real-time pipes has been created in the
>> mean-time: it is the xddp sockets.
> 
> If I well understand, your reimplemented select calls a function that
> communicates with a thread dealing with linux files descriptors through the
> XDDP protocol.


No, I used select() in a thread running in primary mode, and
__real_select() in a thread running with the SCHED_OTHER policy, so most
of the time in secondary mode. Every time __real_select returned an
event for a plain Linux file descriptor which was relevant for the
thread running in primary mode, a message was sent to it through a posix
message queue, which descriptor was included in the set of file
descriptors passed to the select() call.

The XDDP socket would be used the other way around: to wake up the
thread blocked in __real_select and inform it of some event detected by
the thread running in primary mode, but I never had to implement that.

I never tried to hide this behaviour behind a higher level "select", as
I wanted the thread calling the select() service to stay in primary
mode, and processing some events on linux file descriptors required
services to be run in secondary mode, so, the two loops had to be kept
separate, and I believe in fact it is always the case.

-- 
                                                                Gilles.


  reply	other threads:[~2013-05-08 20:49 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518ABA3D.5070106@xenomai.org \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=duch.alexandre@gmail.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.