On Nov 18, 2006, at 3:26 PM, Joe Huber wrote:

But the Q is, if I call a function outside the thread ( like the well known "CopyFileandFolder" that works recursive ) .. then it is not threaded?

Just to be clear, anything you call from a thread will be run in that thread, so yes it is threaded.

However that code may not necessarily yield to other threads as other as you'd like. There may be little you can do about it unless that code it written in either RB or as an RB plugin and you can add code to Yield more often.

Other thoughts:

Write a slave app that is controlled by your main app, that is launched from the shell, communicates with your main app via a socket, and does all the file work. This will even take advantage of multiprocessing. (This is a point where we could reflect how nice it would be if we could build a console app or a gui app from the same code by changing a compiler option).

Do your file work via shell commands.

Do your work in pieces (copy a bit of the file at a time, by reading from the source and writing to the destination), explicitly yielding time in between (obviously, convert to the moral equivalent for whatever mysterious thing it is that you're actually doing).

Regards,

Guyren G Howe
Relevant Logic LLC

guyren-at-relevantlogic.com ~ http://relevantlogic.com

REALbasic, PHP, Python programming
PostgreSQL, MySQL database design and consulting
Technical writing and training


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to