On Sat, 22 Feb 2003, Keith Whitwell wrote:
> 
> Does flush get called when the process (thread) dies as well?  I'm seeing 
> identical behaviour for flush() as release() -- both are being called once 
> despite multiple threads holding copies of the fd.

Threads share the file descriptors, so in a threaded environment, when 
thread X closes the file descriptor, then it gets closed for thread Y as 
well.

> These threads (rh7.3) each have a unique pid, btw.

You could use "tgid" ie the thread group id, but that only works with
modern-style threads (ie the rh-8.1 beta).

I think the solution is to not use "pid". EVER.

Why do you care? Code that cares about pid relationships with file 
descriptors is buggy. As you've found out.

                Linus



-------------------------------------------------------
This SF.net email is sponsored by: SlickEdit Inc. Develop an edge.
The most comprehensive and flexible code editor you can use.
Code faster. C/C++, C#, Java, HTML, XML, many more. FREE 30-Day Trial.
www.slickedit.com/sourceforge
_______________________________________________
Dri-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to