Re: while loop and select
| From: | Christian Weiske | Date: | Sat, 17 Dec 2005 09:14:30 +0000 |
| Subject: | Re: while loop and select | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-6418@lists.php.net to get a copy of this message | ||
Will,
> But when it gets to the select() the program is blocked from execution
> while it waits for input and so
That's exactly the problem with not having threads. The main loop can't
run while the socket reading function blocks program execution
> GTK gets frozen and cannot redraw I suppose. Then it says "Not
> Responding" and dies.
You can use the well-known
> while (Gtk::events_pending()) { Gtk::main_iteration();}
*if* the code continues and the socket reading function returns after
some seconds or so.
That would be possible:
while(socket_not_closed) {
read_for_some_milliseconds();
while (Gtk::events_pending()) { Gtk::main_iteration();}
}
Just the question where to get the read_for_some_milliseconds() function :)
--
Regards/MfG,
Christian Weiske
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc