diff --git a/lib/thread-safe.lisp b/lib/thread-safe.lisp index b464265..ca8ab9b 100644 --- a/lib/thread-safe.lisp +++ b/lib/thread-safe.lisp @@ -2,18 +2,26 @@ ;;; SIMPLE AND SAFE SLIME MODE ;;; ========================== ;;; -;;; Loading this file before loading EQL code guarantees running EQL functions in the GUI thread. +;;; Loading this file before calling any EQL function (involving the UI) +;;; guarantees running EQL functions on the UI thread. ;;; -;;; This means that we don't need a Slime REPL-hook, making it safe to evaluate any EQL code in -;;; Slime, both on the REPL and using 'eval-region'. +;;; This means that we don't need a Slime REPL-hook, making it safe to evaluate +;;; any EQL code in Slime, both on the REPL and using 'eval-region'. ;;; -;;; The only drawback is a little more consing for every EQL function call, but allowing to safely -;;; call GUI functions from any ECL thread. +;;; The only drawback is a little more consing for every EQL function call, but +;;; allowing to safely call UI functions from any ECL thread. ;;; -;;; Note also that wrapping functions in QRUN* is basically the same as a direct call, if called -;;; from the ECL main thread (GUI thread), so it will add almost no overhead. -;;; Since most EQL function calls are driven by the Qt event loop anyway, you won't even notice -;;; the presence of macro QRUN* (performance wise). +;;; Note also that wrapping functions in QRUN* (like done here, see below) is +;;; basically the same as a direct call, if called from the ECL main thread (UI +;;; thread), so it will add almost no overhead. Since most EQL function calls +;;; are driven by the Qt event loop anyway, you won't even notice the presence +;;; of macro QRUN* (performance wise). +;;; +;;; N.B: If you want to start/run EQL in a thread (other than the UI one), you +;;; just need to add this file to your project. Note that any EQL function call +;;; will now do a thread switch internally, so you may experience (much) slower +;;; execution. See also comment in 'examples/X-extras/primes-thread.lisp' about +;;; manually wrapping repeated calls in macro QRUN*. ;;; (in-package :eql)