--MimeMultipartBoundary
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
From: Michael O'Reilly
Sent: 10 October 1997 02:19
To: Larmour, Jonathan
Cc: 'Andres Kroonmaa'; 'squid-dev@nlanr.net'
Subject: Re: apache style squid?
"Larmour, Jonathan" <Jonathan.Larmour@uk.origin-it.com> writes:
>
> Also don't forget one of the classic thread problems. With multiple
> readers and writers, if you have lots of readers (as very busy
caches
> would), then there may not be a point at which the number of
readers
> has returned to 0 and the writer can come in. So you should give
> priority to writers at all points.
No, in this if you only have readers, and there's only one possible
writer, you don't need to lock at all. You don't need to wait for the
readers to stop or any such thing. You just write it.
Only if your update is atomic, and I know there are some RISC
architectures out there that do everything with registers, so there
are 3 instructions for load, modify, and store. It can be interrupted
at any of these points. I confess I can't remember the architectures
involved :-(, but someone else may remember.
It also doesn't apply on any architecture where you are doing
something more compilicated than assignment or addition on a
processor word. Anything that requires more than one step, e.g.
updating a linked list, would require locking the readers as well, in
case a writer wants in. (But of course, I'm not talking about not
having multiple readers in normal conditions).
Jonathan L.
Origin, 323 Cambridge Science Park,Cambridge,UK. Tel:+44 (1223)
423355
---[ It is impossible to enjoy idling thoroughly unless one has ]---
------------[ plenty of work to do - Jerome K. Jerome ]-------------
Fight spam! http://spam.abuse.net/ These opini
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv
iQA/AwUBND46hoYLUv2rigzBEQJt9QCfeEgw7Oywa0AEK39vrS/9UxjZUtoAnjDB
IFQid8PQMYNyrUQ8+ikYj+iF
=VwHS
-----END PGP SIGNATURE-----
--MimeMultipartBoundary--
Received on Tue Jul 29 2003 - 13:15:43 MDT
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:11:27 MST