Proposal: a revoke() system call

Poul-Henning Kamp phk at phk.freebsd.dk
Mon Jul 7 07:51:15 UTC 2008


In message <48714866.906912CC at verizon.net>, Sergey Babkin writes:
>Hi all,
>
>I want to propose a system call with the following functionality:
>
>Syntax:
>
>  int revoke(int fd, int flags)

We already have a revoke(2) system call, so the name will
have to be something different.

>Rationale:
>
>In the multithreaded programs often multiple threads work with the
>same file descriptor. A particularly typical situation is a reader
>thread and a writer thread. The reader thread calls read(), gets
>blocked until it gets more data, then processes the data and
>continues the loop. Another example of a "reader thread" would be 
>the main thread of a daemon that accepts the incoming connections
>and starts new per-connection threads. 

Have you tried to implement the functionality you're asking for ?

You'll have to hunt down into all sorts of protocols, drivers
and other code to find the threads sleeping on your fd so you can
wake them.

It may be quite a piece of work.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.


More information about the freebsd-arch mailing list