Re: CLONE_FILES problem.

Matthias Urlichs (smurf@smurf.noris.de)
Mon, 19 Aug 1996 13:18:46 +0200 (MET DST)


Hi,

Alan Cox wrote:
>> 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.
>
>Bumping the count as suggested elsewhere is a much more elegant, scalable
>and self locking answer.
>
Depends on what you want to do. For files at least, I'd want the file
descriptor to be closed, period. This means that if thread A reads from the
modem and thread B wants to close things down, thread B close()s the file
and A notices this somehow (EOF, signal, whatever).

Memory mappings can of course use counters, but you'd have to add the
appropriate unlock calls to every procedure which uses verify_area.
This is probably something that should have been done from the beginning...

-- 
Matrix Technicians do it in relays
-- 
Matthias Urlichs         \  noris network GmbH  /  Xlink-POP Nürnberg 
Schleiermacherstraße 12   \   Linux+Internet   /   EMail: urlichs@noris.de
90491 Nürnberg (Germany)   \    Consulting+Programming+Networking+etc'ing
   PGP: 1024/4F578875   1B 89 E2 1C 43 EA 80 44  15 D2 29 CF C6 C7 E0 DE
       Click <A HREF="http://info.noris.de/~smurf/finger">here</A>.    42