[Openmcl-devel] Modal dialog problems with CCL 1.9 32/64 on Mountain Lion
alexander.repenning at Colorado.EDU
Thu Sep 6 13:32:12 PDT 2012
On Sep 5, 2012, at 7:49 PM, Gary Byers wrote:
> Just to clarify (I saw Alex's message indicating that our emails crossed):
> There are/have been several ways in the CCL IDE code base of forcing
> something to execute in the main thread. All of them ultimately call
> either CCL::QUEUE-FOR-EVENT-PROCESS (which simply arranges that the
> event process will run a specified function "soon") or
> CCL::CALL-IN-EVENT-PROCESS (which waits until the event process runs
> the function and returns the value(s) it returns.) These functions
> now default to using #/performSelectorOnMainThread... in preference to
> using libdispatch.
> User code that uses things like GUI:EXECUTE-IN-GUI shouldn't have to
We have done some testing. So far it seems as if this is holding up much better. Thank you! Opening up projects will no longer result in the memory surge.
However, opening up a number of projects and then clicking controls will still result in the memory surge after a while.
Just to be sure: you did not actually change GUI:EXECUTE-IN-GUI (that one already appeared to have used #/performSelectorOnMainThread previously) but did change CCL::QUEUE-FOR-EVENT-PROCESS and CCL::CALL-IN-EVENT-PROCESS , correct?
There is a lot of event handling code that includes Matt's in-main-thread:
(defmacro IN-MAIN-THREAD (() &body body)
(let ((thunk (gensym))
`(let ((,done nil)
(flet ((,thunk ()
(setq ,result (multiple-value-list (progn , at body))
(process-wait "Main thread" #'(lambda () ,done))
Could there be some bad interaction with the process-wait and the changed functions above?
Why is process-wait used given that execute-in-gui calls #/performSelectorOnMainThread: with :waitUntilDone: set to true? I assume it was used to make sure that the call is synchronous, i.e., wait for the function to be called by execute-in-gui to finish.
More information about the Openmcl-devel