Gnus development mailing list
 help / color / mirror / Atom feed
From: Sudish Joseph <sudish@mindspring.com>
Subject: Re: [ patch ] async stuff fix(?) (was Re: 0.3 and async pre-fetch)
Date: 06 Aug 1996 02:08:16 -0400	[thread overview]
Message-ID: <m291bt2gfj.fsf@atreides.erehwon.org> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of 05 Aug 1996 19:11:53 +0200

In article <x6wwzdwyau.fsf@eyesore.no>,
Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:
>> discarded for every article prefetched currently), d) make it easier
>> to guarantee that responses are tagged with the correct group-article
>> id.

> It'd make it harder to guarantee anything, because things would then
> rely on variables that might have changed in the meantime.  

There's only one shared variable: the queue tracking group/article
pairs.  This variable has nice properties that make it easy to share.

a) It's a strict producer-consumer buffer with the very useful
property of being unbounded (we look at a finite subset of the buffer
at any given time, but that subset moves monotonically along the
unbounded buffer).  This means that the thornier of the two issues
requiring a lock in P-C problems is eliminated: we never have to check
for overflow.  This leaves underflow.

b) The producer (gnus-async-prefetch-article) always stays a fixed
number of items ahead of the consumer (*).  More importantly, the
producer stops producing at a point when gnus-use-article-prefetch
items are still left in the buffer.  So, underflow is trivially
testable in the consumer w/o needing a lock.

(*) Well, it's guaranteed to be at least one full item ahead of the
consumer, until it's never going to produce anymore.  (I think...:-)
This is because the producer kicks off each consumer.

Note that the current async prefetch buffer stuff makes the same
assumptions as above and works for the same reasons.

I knew all those OS courses would be useful someday. :-)

> Generating a fresh function with the proper values already there is
> much nicer, I think.

Well, it doesn't have any advantages over a static filter as far as
concurrency management is concerned: the marks in the buffer have the
same problems as any shared variables.  (One way of eliminating this
was what I wrote about the interfacwe: have the filter return a
string/generate a new buffer for each response and let the producer be
the only one using the async buffer.)

Either way is good, of course.  I prefer a static buffer because it's
conceptually simpler.  Your callbacks are kewler, of course.

-Sudish


  reply	other threads:[~1996-08-06  6:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-01 23:41 0.3 and async pre-fetch Sudish Joseph
1996-08-02  1:31 ` 0.3 and async pre-fetch (and YA bug report) Raja R Harinath
1996-08-02 17:35 ` 0.3 and async pre-fetch Lars Magne Ingebrigtsen
1996-08-03  0:35   ` Sudish Joseph
1996-08-04 22:09     ` [ patch ] async stuff fix(?) (was Re: 0.3 and async pre-fetch) Sudish Joseph
1996-08-05  0:39       ` Sudish Joseph
1996-08-05 17:11       ` Lars Magne Ingebrigtsen
1996-08-06  6:08         ` Sudish Joseph [this message]
1996-08-06 20:51           ` Lars Magne Ingebrigtsen
1996-08-05 18:20       ` Ken Raeburn
1996-08-05 17:00     ` 0.3 and async pre-fetch Lars Magne Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m291bt2gfj.fsf@atreides.erehwon.org \
    --to=sudish@mindspring.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).