<div>Hi Laszlo Nagy,</div>
<div> </div>
<div>Thanks a lot.</div>
<div>But the issue over here is that how will the child thread acknowledge the main thread that it has completed its task. For this I'll have to set some flag in the child thread and poll for it in the main thread. This will create a problem. Any alternatives??
</div>
<div> </div>
<div>Thanks & Regards,</div>
<div>Tarun<br><br> </div>
<div><span class="gmail_quote">On 11/13/07, <b class="gmail_sendername">Laszlo Nagy</b> <<a href="mailto:gandalf@shopzeus.com">gandalf@shopzeus.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid"><br>><br>> *New Problem: *I am opening and executing a script from the GUI. The<br>> script has a many log messages,
<br>> which it posts on some shared memory. The GUI reads the messages from<br>> the shared memory,<br>> in the Idle loop. But the script is huge and so the logging is not<br>> run-time.<br>> Rather this happens only after the script has executed. Moreover, the
<br>> GUI becomes<br>> un-responsive till the script has completely executed.<br>><br>This is (probably) because you are running your script in your main<br>thread. While the main thread of the application is running, your
<br>windowing system cannot process message queues. Since the updating of a<br>text control uses window messages, it has no chance to process them. I<br>recommend that you run your script in a separate (terminateable?)<br>
thread, send your messages into a Queue instance, and load messages from<br>that queue in your main thread.<br>><br>> Do you have any suggestions for this?<br>Well, if you do not want to create more threads, it migth work if you
<br>call this periodically from your main thread (but I did not try this):<br><br><br> wxApp::Dispatch<br><br>*virtual void* *Dispatch*()<br><br>Dispatches the next event in the windowing system event queue.<br><br>This can be used for programming event loops,
e.g.<br><br>while (app.Pending())<br> Dispatch();<br><br><br></blockquote></div><br>