lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On 10/11/07, Edgar Toernig <> wrote:
> I.e. glib's popen2 (with that looong name) looks like a solid
> base.  Together with its io-queues and the select-based main
> loop you have everything to get deadlock-free bidirectional
> communication.

This is probably the only way one can do this and be completely safe.
One could make popen2 return a third value which is a control object,
but this is useless if you're blocking in stdio anyway.

I've used the GTK stuff successfully in a SciTE extension, and also
worked out the Windows equivalent: you spawn the process in a new
thread, and use SendMessage to post output back to the GUI thread.  I
can provide code if anybody is interested.

steve d.