Threaded event loop, is it possible?

Is it possible to use a thread to run the event loop of my SDL based
applicacation on Windows??

I’m porting a modular Motorola 68k emulator to Windows (from Linux), and
one of the “modules” (video display device) is based on SDL. The user is
free to choose whether to use or not to use the video display device at
any time. The constructor of the Display class initializes SDL and
creates the display surface (windowed SDL video mode), and forks a
thread that keeps waiting for keypress/keyrelease events until the user
detaches the video display device from the emulator. The destructor
sends a cancelation signal to the thread and waits for it to finish; it
also quits SDL. I have tried using pthread-win32 thread library from
RedHat, and SDL threads (which pressumably use winapi threads using the
native win32 SDL dll). The behaviour I get in both cases is a frozen
window, which actually responds to keyboard events (the thread seems to
do its work OK), and the surface seems to display everything as I
expect… ?What’s wrong with my event loop being executed by a thread?

Any help would be much appreciated.

Best regards,–
Claudio Alvarez