I'll copy/paste Zarf's post. I don't know whether this technique will be of any use to you, but I figure I might as well bring it up. Cheers!
"I lay out a model for implementing a two-threaded Glk library -- one
thread for the user interface, one for the virtual machine (Glulx). I
used this when implementing Glk for iOS.
http://eblong.com/zarf/glk/threading-notes.htmlCocoaGlk tries to do this but has some bugs. So I figured I should write up my plan.
To clarify: this isn't something that game authors have to worry about,
or will even notice. (Except for interpreter bugs if it's done wrong. :)
This is a technique for implementing an interpreter which runs smoothly
on a modern GUI OS."
http://www.intfiction.org/forum/viewtopic.php?f=38&t=14672