RE: WaitForMultipleObjects/etc. In Kernel

From: Network Nut
Date: Sun Jan 26 2014 - 17:10:23 EST


> -----Original Message-----
> From: Clemens Ladisch [mailto:clemens@xxxxxxxxxx]
> Sent: Sunday, January 26, 2014 12:33 PM
> To: Network Nut
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Subject: Re: WaitForMultipleObjects/etc. In Kernel
>
> Network Nut wrote:
> > I think that the facility by which a thread can block while waiting
> > for any of several synchronization primitives (*mutex*, *semaphore*,
> > *event*, *waitable timer*)...is not only "nice to have", but
> > fundamental to complex (clean) multi-threaded programming.
>
> You mean a facility like (e)poll, which can wait for things like timerfd,
signalfd,
> or eventfd?
>
>
> Regards,
> Clemens

Yes, that seems to be what I am looking for.

I have a concern:

As you know, under Windows, synchronization objects such as {event | mutex |
semaphore | timer}; all have names that are computer-global. Process B can
open, and use, any {event | mutex | semaphore | timer} that was created by
process A, as long as Process B knows the name that was used by Process A to
create the {event | mutex | semaphore | timer}. These synchronization
objects may also be nameless if the programmer so chooses, in which case,
process B would have to use a circuitous method to determine how to find the
kernel-object created by Process A.

Is there a method I can use where Process A and Process B can both refer to
the same eventfd by name?

BTW, the man page for epoll_wait seems to be incorrect. It says:

"The timeout argument specifies the minimum number of milliseconds
that epoll_wait() will block."

I think the word "minimum" should be "maximum".

Regards,

-Nut



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