08-17-2006 08:11 AM
08-18-2006 03:07 PM
08-20-2006 03:27 AM
Hi Matt,
Thank you so much for the excellent answere. I will soon start to experiment with the different issues.
Meantime, I'm wondering how to make my dll multi-thread safe. Can you point out an example that does it?
Also, in one of the links I read that if a variable is created (e.g. my global buffer) when called by the threads, then, 2 threads can use the same buffer in paralle since it will actually be a separate buffer. Is that correct?
Thanks
Rafi
08-21-2006 08:51 AM
Hi Matt,
My program began to run multithreading but i encounter problems...
Since my application calls functions in another dll, I defined a lock object in that dll (created when dll is loaded, and deleted when dll is unloaded.) . Then, I use cmtGetLock and cmtReleaseLock few places (like writing to log file).
I get a run-time error when I call TS to get a value of a StationGlobal. I assumed that all calls to CVI, TS are thread safe. Isn't it so? I put the lock/release around that call but it still fails. Strangely it alway pass the first time and fail only on the second or third time I run my program. Any explanation to that?
I read the article "Multithreading in LabWindows/CVI" and I'm wondering if you know of any article that describe how to do multithreading in CVI + TestStand?
for example....the CmtScheduleThreadPoolFunction() is required in CVI. Is it required when using TestStand?
I read about the different methods to make your dll multithreading safe (lock, variable safe). It seems much more complex than I initially thought. Since my dll is already written and not so small, I'm wondering If it is too risky to try and make it multithreading safe. Can you tell me from your experience is it something worth trying or better to stay away from?
Thanks
Rafi
08-21-2006 11:15 AM