|
|
On 30 Jan 2004 05:05:18 -0500, Warp <war### [at] tagpovrayorg> wrote:
> StephenS <ssh### [at] ottawanet> wrote:
>> When the program is working on a large file(Optimizing), I can't go to
>> another program (POV-Ray) and back to check if it's done. The
>> WinMeshcomp
>> window is unresponsive.
>
> That's normal because the program is calculating in a busy-loop and
> does
> not listen to Windows' queries.
> I don't know how Windows programs are made "responsive" even while they
> are making heavy calculations. I suppose that they have to make some
> system call once in a while or something similar. Does anyone have a tip?
Multi-threading.
Launch a new thread for the calculations, and let the old one handle the
GUI.
An alternative would be to do the calculations in small chunks (easy if
there's a big loop involved) and do a message dispatch between chunks.
In my opinion, the MT approach is the preferred one. It's both cleaner and
more robust.
Post a reply to this message
|
|