All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [Xenomai] [Xenomai-git] Jan Kiszka : lib/cobalt: Provide RT-capable usleep
       [not found] <E1b7OM2-0000oL-Q7@sd-51317.xenomai.org>
@ 2016-05-30 15:20 ` Gilles Chanteperdrix
  2016-05-31 11:06   ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2016-05-30 15:20 UTC (permalink / raw)
  To: xenomai

On Mon, May 30, 2016 at 04:39:42PM +0200, git repository hosting wrote:
> Module: xenomai-jki
> Branch: for-forge
> Commit: ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
> URL:    http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
> 
> Author: Jan Kiszka <jan.kiszka@siemens.com>
> Date:   Mon May 30 14:58:07 2016 +0200
> 
> lib/cobalt: Provide RT-capable usleep
> 
> User may expect this (probably last) sleeping service to be available
> under Cobalt just like sleep, nanosleep & Co.

CONFORMING TO
       4.3BSD,  POSIX.1-2001.   POSIX.1-2001  declares this function obsolete;
       use nanosleep(2) instead.  POSIX.1-2008 removes  the  specification  of
       usleep().

-- 
					    Gilles.
https://click-hack.org


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

* Re: [Xenomai] [Xenomai-git] Jan Kiszka : lib/cobalt: Provide RT-capable usleep
  2016-05-30 15:20 ` [Xenomai] [Xenomai-git] Jan Kiszka : lib/cobalt: Provide RT-capable usleep Gilles Chanteperdrix
@ 2016-05-31 11:06   ` Jan Kiszka
  2016-05-31 11:32     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2016-05-31 11:06 UTC (permalink / raw)
  To: Gilles Chanteperdrix, xenomai

On 2016-05-30 17:20, Gilles Chanteperdrix wrote:
> On Mon, May 30, 2016 at 04:39:42PM +0200, git repository hosting wrote:
>> Module: xenomai-jki
>> Branch: for-forge
>> Commit: ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
>> URL:    http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
>>
>> Author: Jan Kiszka <jan.kiszka@siemens.com>
>> Date:   Mon May 30 14:58:07 2016 +0200
>>
>> lib/cobalt: Provide RT-capable usleep
>>
>> User may expect this (probably last) sleeping service to be available
>> under Cobalt just like sleep, nanosleep & Co.
> 
> CONFORMING TO
>        4.3BSD,  POSIX.1-2001.   POSIX.1-2001  declares this function obsolete;
>        use nanosleep(2) instead.  POSIX.1-2008 removes  the  specification  of
>        usleep().

Do you expect people - and specifically Linux - to follow this soon?

The idea here is to reduce the level of surprise, and as long as using
usleep in your app doesn't cause an "undefined symbol" error, this risk
persists.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA ITP SES-DE
Corporate Competence Center Embedded Linux


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

* Re: [Xenomai] [Xenomai-git] Jan Kiszka : lib/cobalt: Provide RT-capable usleep
  2016-05-31 11:06   ` Jan Kiszka
@ 2016-05-31 11:32     ` Gilles Chanteperdrix
  2016-05-31 12:18       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2016-05-31 11:32 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

On Tue, May 31, 2016 at 01:06:23PM +0200, Jan Kiszka wrote:
> On 2016-05-30 17:20, Gilles Chanteperdrix wrote:
> > On Mon, May 30, 2016 at 04:39:42PM +0200, git repository hosting wrote:
> >> Module: xenomai-jki
> >> Branch: for-forge
> >> Commit: ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
> >> URL:    http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
> >>
> >> Author: Jan Kiszka <jan.kiszka@siemens.com>
> >> Date:   Mon May 30 14:58:07 2016 +0200
> >>
> >> lib/cobalt: Provide RT-capable usleep
> >>
> >> User may expect this (probably last) sleeping service to be available
> >> under Cobalt just like sleep, nanosleep & Co.
> > 
> > CONFORMING TO
> >        4.3BSD,  POSIX.1-2001.   POSIX.1-2001  declares this function obsolete;
> >        use nanosleep(2) instead.  POSIX.1-2008 removes  the  specification  of
> >        usleep().
> 
> Do you expect people - and specifically Linux - to follow this soon?
> 
> The idea here is to reduce the level of surprise, and as long as using
> usleep in your app doesn't cause an "undefined symbol" error, this risk
> persists.

The thing is adding services do not come for free: it incurs a
maintenance cost. From my point of view, one of the imperatives of
the Xenomai project is to keep the code base small (and simple) so
that it remains possible to maintain it with the little work force
we have. From this point of view, adding a wrapper for a service
that has been deprecated for 15 years, and removed from the POSIX
specification for 8 years does not look like a smart move. And every
time we want to add a service, we should wonder if it is worth the
maintenance burden it incurs, this is the reason why I questioned
adding pthread_setschedprio too.

That being said, I am not opposed to this, and will happily let
other people decide. I just wanted to make sure that everyone
realized that usleep has been dead a long time.

If people use usleep, they will get a switch to secondary mode and
realize they should not use it, it is not as if it could cause a
crash or something. We might even document that somewhere.

-- 
					    Gilles.
https://click-hack.org


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

* Re: [Xenomai] [Xenomai-git] Jan Kiszka : lib/cobalt: Provide RT-capable usleep
  2016-05-31 11:32     ` Gilles Chanteperdrix
@ 2016-05-31 12:18       ` Gilles Chanteperdrix
  0 siblings, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2016-05-31 12:18 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: xenomai

On Tue, May 31, 2016 at 01:32:16PM +0200, Gilles Chanteperdrix wrote:
> On Tue, May 31, 2016 at 01:06:23PM +0200, Jan Kiszka wrote:
> > On 2016-05-30 17:20, Gilles Chanteperdrix wrote:
> > > On Mon, May 30, 2016 at 04:39:42PM +0200, git repository hosting wrote:
> > >> Module: xenomai-jki
> > >> Branch: for-forge
> > >> Commit: ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
> > >> URL:    http://git.xenomai.org/?p=xenomai-jki.git;a=commit;h=ec9a8c81944d4a3e3f50af314fa58ade68dd28c2
> > >>
> > >> Author: Jan Kiszka <jan.kiszka@siemens.com>
> > >> Date:   Mon May 30 14:58:07 2016 +0200
> > >>
> > >> lib/cobalt: Provide RT-capable usleep
> > >>
> > >> User may expect this (probably last) sleeping service to be available
> > >> under Cobalt just like sleep, nanosleep & Co.
> > > 
> > > CONFORMING TO
> > >        4.3BSD,  POSIX.1-2001.   POSIX.1-2001  declares this function obsolete;
> > >        use nanosleep(2) instead.  POSIX.1-2008 removes  the  specification  of
> > >        usleep().
> > 
> > Do you expect people - and specifically Linux - to follow this soon?
> > 
> > The idea here is to reduce the level of surprise, and as long as using
> > usleep in your app doesn't cause an "undefined symbol" error, this risk
> > persists.
> 
> The thing is adding services do not come for free: it incurs a
> maintenance cost. From my point of view, one of the imperatives of
> the Xenomai project is to keep the code base small (and simple) so
> that it remains possible to maintain it with the little work force
> we have. From this point of view, adding a wrapper for a service
> that has been deprecated for 15 years, and removed from the POSIX
> specification for 8 years does not look like a smart move. And every
> time we want to add a service, we should wonder if it is worth the
> maintenance burden it incurs, this is the reason why I questioned
> adding pthread_setschedprio too.
> 
> That being said, I am not opposed to this, and will happily let
> other people decide. I just wanted to make sure that everyone
> realized that usleep has been dead a long time.
> 
> If people use usleep, they will get a switch to secondary mode and
> realize they should not use it, it is not as if it could cause a
> crash or something. We might even document that somewhere.

And replacing usleep with nanosleep in the application code does not
make the application less portable, quite the contrary in fact, it
makes it compatible with POSIX 2008. And if the application really
really want to remain non portable it can provide an usleep
implementation on its side which calls nanosleep under the hood.

-- 
					    Gilles.
https://click-hack.org


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

end of thread, other threads:[~2016-05-31 12:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <E1b7OM2-0000oL-Q7@sd-51317.xenomai.org>
2016-05-30 15:20 ` [Xenomai] [Xenomai-git] Jan Kiszka : lib/cobalt: Provide RT-capable usleep Gilles Chanteperdrix
2016-05-31 11:06   ` Jan Kiszka
2016-05-31 11:32     ` Gilles Chanteperdrix
2016-05-31 12:18       ` Gilles Chanteperdrix

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.