Re: Doubt Regarding Multithreading and Device Driver

From: Al Viro
Date: Wed Apr 27 2005 - 10:48:07 EST

On Wed, Apr 27, 2005 at 09:00:58PM +0530, k8 s wrote:
> But i am sharing something in file->private_data which is a private
> variable to the process(that is passed to the device driver
> functions). Isn't it?

It is not. It is private to struct file. Not to process. And any number
of things (starting with fork()) will give several processes references to
the same struct file. As soon as it had returned from ->open(), it should
be considered externally visible and potentially shared until ->release()
is called.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at