简体   繁体   中英

DLL stop main thread when running

I call a DLL written in C++ (VS2012) from a software (LabView) and what it does is uploading a file on a server via FTP.

While the DLL is uploading the file (15MB) it does not let LabView continue with other tasks. How could this problem be solved?

Regardless of what you have to do on the C++ side to make the call threadsafe, you will need to configure the call in LabVIEW not to run in the UI thread (which I believe is the default configuration, for safety reasons). Double click the node and select the run in any thread option.

Also, if you want to ensure running it in its own thread, you can put it in a separate VI and change the execution settings of that VI to run in a different execution system. LabVIEW doesn't give you direct control of threads, because it manages them on its own, but this should make the VI execute in a different thread.

Operations with FTP are long-term. It is better to perform such operations in another thread.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM