Thanks James for the reply.<br><br><br><div class="gmail_quote">On Tue, Aug 21, 2012 at 3:47 AM, James Cameron <span dir="ltr"><<a href="mailto:quozl@laptop.org" target="_blank">quozl@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im">On Tue, Aug 21, 2012 at 12:11:13AM +0530, Ajay Garg wrote:<br>
> So, is there a way to have the code always in-order; in other words,<br>
> have the GUI updates absolutely synchronous?<br>
<br>
</div>No, not without waiting for the update to complete, and if you do<br>
this, the code runs very slowly.<br>
<br>
(When there is only one CPU, only one process can execute on it at a<br>
time. The updates are placed in a pipeline to the display, and the<br>
display process runs them as soon as it is practical to do so. If<br>
your process does not release the CPU, then your process will likely<br>
continue executing until it hits something that will cause it to<br>
release. It is better to be specific and use idle_add to release.)<br></blockquote><div><br>Right.<br><br>Now, from what I believe, that there is just one "main" thread, that is responsible for running the "normal, backend" code, and the same "main" thread does the GUI updates (of the events present in the display pipeline), when it has nothing more to do with the "normal, backend" code.<br>
<br>This also means, that doing something like<br><br> main_thread.wait()<br><br>would be idiotic, as that would stall the GUI updates as well.<br><br><br><br><br>So, does there exist a method, that could cause doing the GUI updates in a different (other than the "main" thread) ?<br>
If yes, that would solve the issue, as the following would then be feasible ::<br> <br> <main thread> logic statement 1<br> <main thread> spawn a new thread, and pass the GUI-update event to it |<br>
<main thread> "joins" on the new thread | <br> | anywhere in this interval, the new thread performs the GUI update<br>
|<br> |<br>
new thread terminates<br> <main thread> logic statement 2<br><br><br><br>At first, it seems that the "<b><main thread> spawn a new thread, and pass the GUI-update event to it</b>" step is trivial.<br>
However, the thing to note that in a default python configuration, all GUI update events are scheduled in the context of the main thread.<br><br>So, only if the GUI update events could be scheduled to be processed in a custom thread - that would be awesome !!!<br>
<br><br>Please let me know if any such method exists :)<br><br><br>Thanks and Regards,<br>Ajay<br><br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
James Cameron<br>
<a href="http://quozl.linux.org.au/" target="_blank">http://quozl.linux.org.au/</a><br>
</font></span></blockquote></div><br>