Erik,
"Render" == "draw". :-)
By "I don't know" I meant to imply that I didn't know if they needed to be *created* in the pane's process. Since you are drawing multiple things to a port in order to generate your thumbnail, then yes, that part does need to take place in the pane's process. I thought that perhaps you were doing something different.
At this point, my only suggestions (others may have better options) would be one of the following:
1. Have a thumbnail generation queue that is periodically processed to continuously generate the thumbnails from within the pane process. Each entry in the queue would likely either some data used to draw the next piece of a thumbnail (the pixmap port and the operation) or just a closure that does it.
Pseudo code:
(defvar *thumbnail-queue*)
(defun insert-thumbnail-operation (function)
(enqueue *thumbnail-queue* function))
(defun process-thumbnail-queue (pane)
(apply-in-pane-process pane
(loop for a few milliseconds...
(let ((op (dequeue *thumbnail-queue*)))
(funcall op)))))
(defun create-example-thumbnail (pane port)
(insert-thumbnail-operation #'(lambda () (gp:draw-line port 0 0 100 100)))
(insert-thumbnail-operation #'(lambda () (gp:draw-circle port 50 50 10)))
(insert-thumbnail-operation #'(lambda () (notify-pane-thumbnail-complete pane port))))
I'm not sure if this solution will have issues with GP state changes (e.g. setting the color or thickness of the line you'd like to draw). But most GP function calls allow you to pass those options as keywords instead of modifying the global state before the call.
2. Use something other than LispWorks to generate the thumbnails. For example, you can wrap ImageMagick (
http://www.imagemagick.org/) use FLI and use similar functions for the operations you want, but just in another thread. Then convert the ImageMagick, in-memory image to a pixmap-port when done (I don't know how to do this, but I'm sure others here have done it).. This likely requires a higher up-front cost in creating the FLI wrappers if someone else here hasn't already done it.
HTH,
Jeff M.