[plt-scheme] RE: Shared resources for servlets

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Sep 10 15:56:31 EDT 2003

Robby already mentioned "async-channel.ss", but I encourage anyone who
is interested to read the source.

Joe pointed out the need for `dynamic-wind' in case a writer aborts.
But in the web-server, the problem is even worse: the writer's session
might be killed off entirely, in which case it wouldn't release the
lock, and it wouldn't have a chance to release the lock even through
`dynamic-wind'.

The async-channel.ss implementation works correctly even if a writer or
reader is terminated. It relies on a combiantion of

 * channels (the synchronous kind)
 * multiplexed waiting (via `object-wait-multiple')
 * custodian promotion via `thread-resume'

Matthew



Posted on the users mailing list.