Tom Tromey writes: Hi Tom, > Michael> So I'm wondering if we could extend thread support by an > Michael> indication of the thread result, when finished. One idea > Michael> would be that `thread-join' returns with that value. > > This doesn't seem all that hard to implement. Yep. The appended patch does it for me. Maybe you could check whether I'm missing something? > Also if the thread exited due to an exception of some kind, this could > be propagated by thread-join as well. Yeah, this would be a bonus. I've failed to implement it, so I let it to somebody else. I don't need it first-hand. > Michael> The documentation recommends the use of global variables, > Michael> which would be inconvenient for many threads to supervise. > > Or you can use a queue of some kind and have each worker push its > result there. Yes, but you must indicate the worker threads where to push the result. Imagine find-file would support threads for wildcard file names, and somebody calls find-file this way twice, both running concurrently. Every worker thread must know, whether to push the result into the global variable associated with the first call or the second one. Still overhead to implement; I'll prefer that thread-join returns the result. > Tom Best regards, Michael.