Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jun 1999 18:44:54 +0930 (CST)
From:      "Daniel J. O'Connor" <doconnor@gsoft.com.au>
To:        Jesus Monroy <jesus.monroy@usa.net>
Cc:        Ville-Pertti Keinonen <will@iki.fi>, hackers@freebsd.org, "Daniel J.OConnor" <darius@dons.net.au>
Subject:   Re: [Re: [Re: coarse vs fine-grained locking in SMP systems]]
Message-ID:  <XFMail.990626184454.doconnor@gsoft.com.au>
In-Reply-To: <19990626085948.25145.qmail@nwcst277.netaddress.usa.net>

next in thread | previous in thread | raw e-mail | index | archive | help
This message is in MIME format
--_=XFMail.1.3.p0.FreeBSD:990626184454:34751=_
Content-Type: text/plain; charset=us-ascii


On 26-Jun-99 Jesus Monroy wrote:
>      The part I'm lost on is "can change things from under it".
>      From under what? I assume the statement means "it" as being
>      the code or driver. So the question begs, what things can 
>      change?

The assumption that changes is that your code assumes (well mine does :) that
it can only have one processor running at at once for routines like open, read,
etc.. So no locking is done to protect those routines.

Like what happens if CPU 0 is running your drivers open code, then CPU 1 starts
running it (because a user program did an open call) then your driver will be
confused because it assumes that the open call is only being executed by one
CPU.

To protect against it you'd need to grab a mutex when you enter open (or block
waiting for the other CPU to release it)

---
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum



--_=XFMail.1.3.p0.FreeBSD:990626184454:34751=_
Content-Type: application/pgp-signature

-----BEGIN PGP MESSAGE-----
Version: 2.6.3ia

iQCVAwUBN3SaDWj0TqzKxF7VAQGsHgP9FcRFdsnAGXJI6rQI+Rt2iiv3HdGfZ3Wq
ouzcis2tvBgGambsXrs3GpEY5O4bzFtSzBVR9j2HgEocRjJ9OLy3rq3OTbWE/ZFS
Tn91QXgA9hx+uWnwz0iU80apRfwD0uwOELBkeAz7q86U25XcKqbyWCec7vHal6Wm
/D8lMsmF8Zg=
=3PkF
-----END PGP MESSAGE-----

--_=XFMail.1.3.p0.FreeBSD:990626184454:34751=_--
End of MIME message


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.990626184454.doconnor>