On 7/18/11 10:50 AM, Daniel Colascione wrote: > If it works, /dev/windows would allow us to get rid of not only the self-pipe > and the clipboard thread, but the UI thread as well, though it'd be easier to > keep the last of these for compatibility for the NT build. Actually, I spoke too soon regarding the clipboard thread: the problem is that when we receive a WM_RENDERFORMAT message, we have to call SetClipboardData _before we return from the window procedure_. This requirement is incompatible with using lisp code to render clipboard content: we might have received a window message at an inopportune time for calling back into Lisp, and we can't delay the response to WM_RENDERFORMAT by re-queuing or somesuch. Today's NT clipboard code doesn't have to address the issue because it never calls into Lisp. We can address this problem by using a separate message loop for the clipboard; that way, the clipboard windowproc can wait as long as it wants to reply to WM_RENDERFORMAT while the main thread does its thing and eventually gets around to calling our queued timer. I think this approach (which my patch implements) is ultimately the right one.