From: Clint Hyde
Subject: RE: throw-catch :cancel
Date: 
Message-ID: <3radk0$iop@info-server.bbn.com>
In article <··········@tools.near.net> ······@nic.near.net (Barry Margolin) writes:

--> In article <·························@riesbeck.ils.nwu.edu> ········@ils.nwu.edu (Chris Riesbeck) writes:
--> >In the discussion on comp.lang.lisp.mcl where this began, my solution
--> >was to use BLOCK/RETURN-FROM rather than CATCH/THROW. I've included
--> >the code below for reference.
--> >
--> >Is this approach is guaranteed to work in any multi-threaded CL?
--> 
--> Nothing is guaranteed, since there's no standard for multi-threaded CL.
--> 
--> I haven't seen the discussion in c.l.l.mcl, so I don't know what problem
--> you're trying to solve.  Do you want one thread to be able to cause a
--> function in another thread to return?  The only multi-threaded Lisp I have
--> lots of experience with is Symbolics CL, and I don't think it handled
--> RETURN or THROW from a different thread than the BLOCK or CATCH.

I've worked with several, and what happens is that you get an error
about "NO LEXICALLY VISIBLE CATCH FOR TAG 'FOO" because there isn't one,
as those kind of tags are "local" to an individual stack-group.

if you want one stack-group to have an effect on another one, you'll
have to do it in the more obvious way of setting some global variable,
or a slot in a shared object, or something easy like that.

if you know how to control your stack-groups, it's perhaps also possible
to force this differently with functions like stack-group-resume,
stack-group-return, stack-group-frame-return, or that sort of thing.  I
have NEVER done this, and I think it's probably dangerous.

both Lucid and Allegro have these kinds of functions.  my CLIM-based
window-debugger makes use of them, but the interesting ones are
undocumented functions--I had to guess at what they did and experiment
with them to decide which ones to use.

 -- clint

From: Chris Riesbeck
Subject: Re: throw-catch :cancel
Date: 
Message-ID: <riesbeck-0906951727390001@riesbeck.ils.nwu.edu>
In article <··········@info-server.bbn.com>, Clint Hyde <·····@bbn.com> wrote:

> In article <··········@tools.near.net> ······@nic.near.net (Barry
Margolin) writes:
> 
>...  The only multi-threaded Lisp I have
> --> lots of experience with is Symbolics CL, and I don't think it handled
> --> RETURN or THROW from a different thread than the BLOCK or CATCH.
> 
> I've worked with several, and what happens is that you get an error
> about "NO LEXICALLY VISIBLE CATCH FOR TAG 'FOO" because there isn't one,
> as those kind of tags are "local" to an individual stack-group.

Right, that's the problem with CATCH/THROW, though the message seems
strange, since CATCH tags are lexically scoped.

For BLOCK/RETURN-FROM, at least in the code I posted, the tag *is* lexically
visible, but, I now realize, you can't be sure it won't be disestablished.

-- 
Chris
From: Chris Riesbeck
Subject: Re: throw-catch :cancel
Date: 
Message-ID: <riesbeck-1206951452010001@riesbeck.ils.nwu.edu>
In article <·························@riesbeck.ils.nwu.edu>,
········@ils.nwu.edu (Chris Riesbeck) wrote:

> In article <··········@info-server.bbn.com>, Clint Hyde <·····@bbn.com> wrote:
> 
> > I've worked with several, and what happens is that you get an error
> > about "NO LEXICALLY VISIBLE CATCH FOR TAG 'FOO" because there isn't one,
> > as those kind of tags are "local" to an individual stack-group.
> 
> Right, that's the problem with CATCH/THROW, though the message seems
> strange, since CATCH tags are lexically scoped.

Only one person caught me so far, but, yes that was supposed to read
"CATCH tags are *not* lexically scoped."

-- 
Chris