LWN.net Logo

Is this not the lisp "future" function?

Is this not the lisp "future" function?

Posted Dec 21, 2007 15:35 UTC (Fri) by ringerc (subscriber, #3071)
In reply to: Is this not the lisp "future" function? by davecb
Parent article: Simpler syslets

That's rather similar to how Java-style threading is done in the case where the "master"
thread and the child task share no data. Presumably that's always the case in lisp, given its
functional design.

Sure, the Java approach is uglier and more verbose, but the principle remains practically the
same. You can use a callback or (with the TrollTech Qt approach) event in the event loop to
detect completion. Or you can just poll for completion by testing an instance variable of the
thread subclass.

http://java.sun.com/j2se/1.3/docs/api/java/lang/Thread.html

A similar approach can be used in C++ with Qt. It's really rather nice, and makes threading
quite sane for launching independent deferred calls that should produce a result "later".


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds