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




_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[email protected]"

Reply via email to