Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 11 Jan 2010 22:52:39 +0330
From:      "H.Fazaeli" <fazaeli@sepehrs.com>
To:        freebsd-hackers@freebsd.org
Subject:   uiomove and mutex
Message-ID:  <4B4B7A7F.2090808@sepehrs.com>

next in thread | raw e-mail | index | archive | help
dear gurus

man mutex(9) states that:

"No mutexes should be held (except for Giant) across functions which
access memory in userspace, such as copyin(9), copyout(9), uiomove(9),
fuword(9), etc.  No locks are needed when calling these functions."

can someone pls. explain why it is so?

Suppose I have a kernel buffer to which kernel writes and
userland processes read via a character device. In the device
read method, If we unlock the mutex just before uiomove, is it
guaranteed that kernel does not write to the buffer in the middle
of uiomove? If yes, how? What is the solution in such a situation?
rwlocks? an intermediate buffer?


-- 

Best regards.
Hooman Fazaeli







Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B4B7A7F.2090808>