|
Re: hacking on 1.7 threads: msg#00091lisp.guile.devel
Julian Graham <joolean@xxxxxxxxx> writes: > I'm attaching a patch (against HEAD, created in guile/ via 'cvs diff > -Nau') that represents the current state of my work on thread > cancellation (except that I removed the cancellation-disabling stuff > I'd added temporarily to gc.c; I wasn't super confident that it had > any effect). Thanks! I haven't really looked at your code yet and I'm not yet really fully into the threading stuff, but one thought might be worth sharing anyway: Guile uses pthreads to implement multi-threading, but a libguile-using program must nevertheless obey special rules and can not just use pthread functions while it is in 'Guile Mode'. For example, you can not just use pthread_mutex_lock to lock an arbitrary pthread mutex because Guile must know when threads are blocking. You must use scm_mutex_lock (together with a Guile mutex) or you must leave Guile Mode. The same rule is likely advantageous for pthread_cancel. We can just state that a thread that is in Guile Mode can not be canceled with pthread_cancel, but that you must use some other function. Actually, wouldn't it be enough to just send a thread an asynchronous exception, like: (use-modules (ice-9 threads)) (define t (begin-thread (let loop () (pk 'foo) (sleep 1) (loop)))) (sleep 2) (pk 'bar) (system-async-mark quit t) (sleep 2) (pk 'exit) Work needs to likely be done so that system-asyncs are able to interrupt a blocking thread in all situations. _______________________________________________ Guile-devel mailing list Guile-devel@xxxxxxx http://lists.gnu.org/mailman/listinfo/guile-devel |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: use-syntax / transformer doc bugs: 00091, Marius Vollmer |
|---|---|
| Next by Date: | Re: Proposal: allow "guile foo.scm": 00091, Marius Vollmer |
| Previous by Thread: | Re: use-syntax / transformer doc bugsi: 00091, Marius Vollmer |
| Next by Thread: | Re: Proposal: allow "guile foo.scm": 00091, Marius Vollmer |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |