[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gwydion & threads



Rob Myers <robmyers@mac.com> wrote:
> On Friday, March 15, 2002, at 12:00 AM, Neelakantan Krishnaswami wrote:
>
> > What's the problem? Is it the two-word representation of objects?
> > That would make it hard to do assignments atomically, which I think
> > the Dylan threads spec requires.
>
> Yes, that's the one. IIRC Andreas wrote a threads test that crashed
> pretty quickly because of this.

I'm sure that's not the only reason.  Threads need to have their own
argument stacks, and
in src/d2c/runtime/dylan/thread.dylan there is per-thread storage for the
exception stacks:

    define class <thread> (<object>)
      slot cur-uwp :: false-or(<unwind-protect>), init-value: #f;
      slot cur-handler :: false-or(<handler>), init-value: #f;
    end;

    define constant $the-one-and-only-thread :: <thread> = make(<thread>);

Locking in the streams library is another issue that needs to be addressed.

Cheers,
-Peter-