On 1/19/07, Jeff Rogers <[EMAIL PROTECTED]> wrote:

A second situation is where there is an expired entry and multiple
threads access it at the same time.  It is probably handled as above, as
if there was no entry.  But it might be desirable in certain situations
to return a stale entry immediately and start a separate thread to run
the script.



That's an interesting idea -- a stale entry might be acceptable some times.

The situation isn't too bad though.  If the server is loaded and
computing the cache entry takes 30 secs, only the first thread, the
computing thread, will take the full 30 sec hit.  The other threads
will wait only -timeout seconds, which may be e.g. 2 secs.

They'll fail. But it least they won't be tied up waiting.

It might be nice for subsequent threads to have the option of getting
a stale value after the timeout period.

Reply via email to