[英]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. 我从软件(LabView)调用了用C ++(VS2012)编写的DLL,它的作用是通过FTP将文件上传到服务器上。
While the DLL is uploading the file (15MB) it does not let LabView continue with other tasks. DLL上传文件(15MB)时,它不允许LabView继续执行其他任务。 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). 不管您要在C ++端执行什么操作以使调用线程安全,都需要在LabVIEW中将调用配置为不在UI线程中运行(出于安全原因,我认为这是默认配置)。 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. 另外,如果要确保在自己的线程中运行,可以将其放在单独的VI中,并更改该VI的执行设置以在其他执行系统中运行。 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.
LabVIEW不直接控制线程,因为它是自己管理线程的,但这将使VI在不同的线程中执行。
Operations with FTP are long-term. FTP的操作是长期的。 It is better to perform such operations in another thread.
最好在另一个线程中执行此类操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.