public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Semaphores with timeouts
@ 2008-02-14  0:08 Ricardo J. Rodríguez
  2008-02-14  0:14 ` Alan Cox
  0 siblings, 1 reply; 3+ messages in thread
From: Ricardo J. Rodríguez @ 2008-02-14  0:08 UTC (permalink / raw)
  To: linux-kernel

Hi everybody,
I'm developing a driver to support a new protocol on the kernel 2.6.x,
a real time communication protocol used in robotic fields. Skipping
the intro: I need to know if there is any function in the kernel to
get the process sleeping, as down_interruptible(...), but with
timeouts, I mean, I want the process to wake up if no signal is
detected in a while...

Thanks anyway,
-- 
Ricardo J. Rodríguez
www.deathhc.tk

#329385 | [Registered Linux User]

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

* Re: Semaphores with timeouts
  2008-02-14  0:08 Semaphores with timeouts Ricardo J. Rodríguez
@ 2008-02-14  0:14 ` Alan Cox
  2008-02-14 13:34   ` Ricardo J. Rodríguez
  0 siblings, 1 reply; 3+ messages in thread
From: Alan Cox @ 2008-02-14  0:14 UTC (permalink / raw)
  To: Ricardo J. Rodríguez; +Cc: linux-kernel

On Thu, 14 Feb 2008 01:08:28 +0100
"Ricardo J. Rodríguez" <ricardo.rdez@gmail.com> wrote:

> Hi everybody,
> I'm developing a driver to support a new protocol on the kernel 2.6.x,
> a real time communication protocol used in robotic fields. Skipping
> the intro: I need to know if there is any function in the kernel to
> get the process sleeping, as down_interruptible(...), but with
> timeouts, I mean, I want the process to wake up if no signal is
> detected in a while...

The Unix world normally expects rather different behaviour

With O_NDELAY set -> no delay but -EAGAIN
Normal -> delay until error or completes or EOF

and the use of poll/select to wait until the event can be issued and is
going to complete. Hence the lack of a mutex_lock_interruptible_timeout()


It's certainly possible to add one but the first question would be "why
do you need it - what sort of API are you trying to build"

Alan

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

* Re: Semaphores with timeouts
  2008-02-14  0:14 ` Alan Cox
@ 2008-02-14 13:34   ` Ricardo J. Rodríguez
  0 siblings, 0 replies; 3+ messages in thread
From: Ricardo J. Rodríguez @ 2008-02-14 13:34 UTC (permalink / raw)
  To: Alan Cox; +Cc: linux-kernel

Hi Alan,

> It's certainly possible to add one but the first question would be "why
> do you need it - what sort of API are you trying to build"
>

The protocol works in adhoc wireless mode, so when I send a packet,
I've to wait a  while before I send it again, like TCP timeout
retransmistions work.

Anyway, I've though maybe I can use SIGALRM to know when it expired
and do whatever...

-- 
Ricardo J. Rodríguez
www.deathhc.tk

#329385 | [Registered Linux User]

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

end of thread, other threads:[~2008-02-14 13:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-14  0:08 Semaphores with timeouts Ricardo J. Rodríguez
2008-02-14  0:14 ` Alan Cox
2008-02-14 13:34   ` Ricardo J. Rodríguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox