Re: Thread implementations...

Magnus Ahltorp (map@stacken.kth.se)
13 Aug 1998 19:05:31 +0200


> A possible solution could be extending of the SIGIO concept in the
> following way:
>
> - SIGIO handler gets an extra parameter containing the FD
> in being reported.
>
> - FASYNC gets split to read and write part

I received this reply from Johnny Eriksson <bygg@swip.net>:

Implement a new set of signals, one for each possible file. Access
this with a macro, SIGFILE(), making the user code something like:

{
FILE * myfile;

/* ... */

signal(SIGFILE(myfile), myhandler);

}

The macro SIGFILE should be defined like:

#define SIGFILE(fp) (-1 - (fileno(fp)))

In the kernel, a table (one entry per file) is needed, and the code
that normally generates the SIGIO signal should first check if there
is a file-specific handler in that table, and if so use that handler,
if not generate a normal SIGIO. This makes SIGIO a catch-all handler
for all files that does not have a SIGFILE handler.

-- End reply from Johnny Eriksson --

/Magnus
map@stacken.kth.se

-
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.altern.org/andrebalsa/doc/lkml-faq.html