lkml.org 
[lkml]   [2001]   [Apr]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: missing poll(2) for semaphores
Just an addition to the sample:

fds[3] = sem3;
fds[4] = sem4;
fds[5] = sem5;
fds[6] = sem6;

.. and wait for any of them? or for all together?
and sure have this mixed with descriptors.

Wellknown win32 api WaitForMultipleObjects provides such
functionality, and having something like
that would help to port the applications using that api.

On Thu, Apr 19, 2001 at 11:46:46AM +0200, Alex Riesen wrote:
Hi, all
i am missing a good (i think) feature of unix descriptors
in SysV semaphores - to be poll(2)-able.
Have someone an idea to somehow achieve the goal ?


something like this:

int sem = create_our_pollable_semaphore();
...
...
pollfd fds[xxx];

for(i=0; i < countof(fds); fds[i++].events = POLLIN|POLLOUT);
fds[0].fd = sem;
fds[1].fd = server_sock1;
fds[2].fd = cmd_sock2;

while ( poll(fds, countof(fds), -1) >= 0 )
...

Thank you in advance

Alex Riesen

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

\
 
 \ /
  Last update: 2005-03-22 13:26    [W:0.135 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site