[proFit-list] threading and pro fit

Chris Lee laserboy at fusemail.com
Fri Mar 21 05:42:28 CDT 2014


Hi All,

I wonder if anyone has had any experience using threading for python scripts in pro fit?

At present, I have a program that has to process a few hundred files. Each processing operation involves opening a data file, extracting some data from the file, perform several minimizations and closing the file. Each file takes a couple of minutes to process on a single core. 

So, I thought I would thread it. I initiate 4 threads and divide the work up between them. However, it seems to me that pro fit only allows one thread access to data at a time (for instance, only one data window is ever open at a time). And, by calling thread.join(), the entire application becomes unresponsive, so the little window that tells you that a script is running is always in front, no matter what application is currently being used by the user.

Should I, instead of calling thread.join, loop and call thread.isalive, before calling thread.join? or is there some other way to ensure that this works.

Another question: is pf.FrontmostWindow() thread safe? So, if I have two threads, and both open a window, how can I be sure that I get the correct window ID in each thread?

Any advice is welcome :)

Cheers
Chris


More information about the proFit-list mailing list