Events, waitqueues ans signals

Vasili Goutas (vgo@ratio.de)
Tue, 15 Sep 1998 14:49:18 +0200


I'm porting a driver from WinNT to Linux and have a problem with the NT
type KEVENT.
In NT the type KEVENT can be an synchronization or a notification event.
A synchr. event can be used like an wait_queue in Linux.
NT code like this:
KEVENT myevent;
KeInitializeEvent(
&myevent,
NotificationEvent,
FALSE //not signaled
);
...
KeSetEvent(
&myevent,
0, //priority
FALSE //wait
);
...
KeWaitForSingleObject(
&myevent,
Executive, //wait reason
KernelMode, //wait mode
FALSE, //alertable
NULL //no timeout
);

could be ported like this I think:
wait_queue myevent;
...
wake_up_interruptible(&myevent);
...
interruptible_sleep_on(&myevent);

this will only work, if the timeout in the NT function is set to FALSE.
What to do if a timeout has to be used??
It's a nice thing to be triggert if the time is over ore a other event
like error
occurs.

Under NT multiply events can be wait for whith the function
KeWaitForMultipleObject(count, object[], ...)
which will return when one of the events in the list is fired.
The calling process knows then which event occurs.

I haven't found a way to wait for multiple events, maybe bye signals,
but I don't know how.

Any ideas are welcome.

Please CC to vgo@ratio.de

TIA
Vasili

-- 

********************************************************************** * Vasili Goutas RATIO Entwicklungen GmbH * * P:+49-(0)40-369007-37 Admiralitätstr. 59 * * F:+49-(0)40-369007-25 D-20459 Hamburg * * Email: mailto:vgo@ratio.de * **********************************************************************

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/