lkml.org 
[lkml]   [1996]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: CLONE_FILES problem.
Matthias Urlichs (smurf@smurf.NOris.DE) wrote:

: The easiest solution is probably to add a global flag (and a wait list)=
: to
: the fd and mm structures -- close() and munmap() would be considered
: "writers", and all other system calls would be "readers" as far as thes=
: e
: structures are concerned. Something should probably be done with
: blocking accesses to files, i.e. if one thread is read()ing from a file
: descriptor which another wants to close, the first should get a signal =
: or
: something.

Why not increment f_count, when grabbing a file struct?
It is graceful solution (checked), and it will make
kernel only more beautiful.

F.e. when one thread writes to socket and sleeps because
of flow control, and second thread closes it, it is removed
from file descriptor table, but not closed really (f_count goes from 2
to 1), so that the first thread will successfuly finish write and socket will
be closed on the exit from sendmsg. Is it not nice?

Alexey Kuznetsov.

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