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

Threading Challenges Continue....



Well, my implementation using the scheme_make_closed_prim
idea didn't work very well.  I then tried something that I
think Paul Steckler suggested, which was to cause the thread
to be created in the Scheme thunk itself, so I implemented
my exn_thunk as follows:

static char* exn_thunk =
  "(#%lambda (thunk) "
     "(#%thread "
         "(#%lambda () "
             "(mv-special-signal (current-thread)"
                 "(#%with-handlers"
                      "([#%void (#%lambda (exn) (#%cons #f exn))]) "
                      "(#%cons #t (thunk)))))))";

Unfortunately this does not work either (giving me the same
segfault in the stack depth check that I saw with the C code.

If I don't include the no-argument lambda form, I get an error
message that the thread function expects to receive a function
argument of the form "<function arity(0)>", but received "#<function>".

Any ideas?

-Brent