Re: [Xenomai-core] Sleep return value

2006-09-09 Thread Bernhard Walle
* Jan Kiszka <[EMAIL PROTECTED]> [2006-09-09 12:28]:
> > Because the missing information can be easily gathered from outside,
> > it would be only worth changing if you plan some other changes in
> > these functions so that this can be done in one in one step.
> 
> You exactly hit the point. :->

Yes, I should first think and then post.


Regards,
  Bernhard
-- 
OpenPGP Schlüssel-ID: B69454FD (kurz) / E8951E8FB69454FD (lang)
Fingerprint: F3BE B2A7 8161 2986 ABA4  9AB9 E895 1E8F B694 54FD


pgp8mIfV1NmtF.pgp
Description: PGP signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Sleep return value

2006-09-09 Thread Jan Kiszka
Bernhard Walle wrote:
> Hello,
> 
> sorry for the late reply.
> 
> * Jan Kiszka <[EMAIL PROTECTED]> [2006-09-06 15:52]:
>> Bernhard Walle wrote:
>>> Hello,
>>>
>>> ,
>>> | int rtdm_task_sleep (uint64_t delay);
>>> | int rtdm_task_sleep_until (uint64_t wakeup_time);
>>> `
>>>
>>> wouldn't it make sense to return 0 on success and in error case the
>>> number of nanoseconds that are remaining to the originally requested
>>> sleep period just as the Linux sleeping function behave?
>> Do you have a use-case for this? Would you consider this as the normal
>> scenario?
> 
> I must confess that I don't have one. I just compared the Linux API
> with the RTDM API for that use case. I'll dig into sources of Linux
> drivers and see if there are reasonable use cases. But this may take
> some days as I'm a bit busy now.
> 
>> Also note that changing the return type would take away to possibility
>> to pass the error code.
> 
> Not really. You can
> 
>   < 0 : error code (in this case -EPERM)
>   == 0 : success
>   > 0 : remaining time
> 
> Or simple
> 
>   int rtdm_task_sleep(uint64_t delay, uint64_t *time_left);
> 
> That would make it more compatible with the current API since the user
> can simply replace
> 
>   ret = rtdm_task_sleep(delay);
> 
> with 
> 
>   ret = rtdm_task_sleep(delay, NULL);
> 
>>> Of course that would introduce an incompatibility to current code.
>> Given a reasonably urging use-case or brokenness of the original
>> interface, API revisions may actually take place in RTDM (see the
>> history). But they will surely not happen without thorough
>> considerations of pros and cons. :)
> 
> Because the missing information can be easily gathered from outside,
> it would be only worth changing if you plan some other changes in
> these functions so that this can be done in one in one step.
> 

You exactly hit the point. :->

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Sleep return value

2006-09-08 Thread Bernhard Walle
Hello,

sorry for the late reply.

* Jan Kiszka <[EMAIL PROTECTED]> [2006-09-06 15:52]:
> Bernhard Walle wrote:
> > Hello,
> > 
> > ,
> > | int rtdm_task_sleep (uint64_t delay);
> > | int rtdm_task_sleep_until (uint64_t wakeup_time);
> > `
> > 
> > wouldn't it make sense to return 0 on success and in error case the
> > number of nanoseconds that are remaining to the originally requested
> > sleep period just as the Linux sleeping function behave?
> 
> Do you have a use-case for this? Would you consider this as the normal
> scenario?

I must confess that I don't have one. I just compared the Linux API
with the RTDM API for that use case. I'll dig into sources of Linux
drivers and see if there are reasonable use cases. But this may take
some days as I'm a bit busy now.

> Also note that changing the return type would take away to possibility
> to pass the error code.

Not really. You can

  < 0 : error code (in this case -EPERM)
  == 0 : success
  > 0 : remaining time

Or simple

  int rtdm_task_sleep(uint64_t delay, uint64_t *time_left);

That would make it more compatible with the current API since the user
can simply replace

  ret = rtdm_task_sleep(delay);

with 

  ret = rtdm_task_sleep(delay, NULL);

> > Of course that would introduce an incompatibility to current code.
> 
> Given a reasonably urging use-case or brokenness of the original
> interface, API revisions may actually take place in RTDM (see the
> history). But they will surely not happen without thorough
> considerations of pros and cons. :)

Because the missing information can be easily gathered from outside,
it would be only worth changing if you plan some other changes in
these functions so that this can be done in one in one step.


Regards,
  Bernhard
-- 
Bei der Eroberung des Weltraums sind zwei Probleme zu lösen: die Schwerkraft
und der Papierkrieg. Mit der Schwerkraft wären wir fertig geworden.
-- Wernher von Braun


pgpRDDcJlF31s.pgp
Description: PGP signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Sleep return value

2006-09-06 Thread Jan Kiszka
Bernhard Walle wrote:
> Hello,
> 
> ,
> | int rtdm_task_sleep (uint64_t delay);
> | int rtdm_task_sleep_until (uint64_t wakeup_time);
> `
> 
> wouldn't it make sense to return 0 on success and in error case the
> number of nanoseconds that are remaining to the originally requested
> sleep period just as the Linux sleeping function behave?

Do you have a use-case for this? Would you consider this as the normal
scenario?

Also note that changing the return type would take away to possibility
to pass the error code.

> 
> Of course that would introduce an incompatibility to current code.

Given a reasonably urging use-case or brokenness of the original
interface, API revisions may actually take place in RTDM (see the
history). But they will surely not happen without thorough
considerations of pros and cons. :)

Jan



signature.asc
Description: OpenPGP digital signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


[Xenomai-core] Sleep return value

2006-09-06 Thread Bernhard Walle
Hello,

,
| int rtdm_task_sleep (uint64_t delay);
| int rtdm_task_sleep_until (uint64_t wakeup_time);
`

wouldn't it make sense to return 0 on success and in error case the
number of nanoseconds that are remaining to the originally requested
sleep period just as the Linux sleeping function behave?

Of course that would introduce an incompatibility to current code.

Regards,
  Bernhard
-- 
Ich denke, es gibt weltweit einen Markt für vielleicht fünf Computer.
-- Thomas Watson, Vorsitzender von IBM (1943)


pgpOsmQVzL5yQ.pgp
Description: PGP signature
___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core