LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling the Same ThreadFunction multiple times

Hi All

 

Please accept my apologies if this question has previously been asked - I have searched around, but could not find an answer. 

 

I am downloading compressed data across a serial connection. I then decompress this data and save to file. The process works, but is currently single threaded. 

 

I would like to implement multi-threading.

 

Essentially, I am planning on breaking the download into chunks. Once a chunk has downloaded, I would like to kickoff the decompressing process. 

 

I (think I) know how to write the ThreadFunction and kick it off - various examples on the NI Website and previous code I have inherited. 

 

I would like to know, if I can call the same ThreadFunction multiple times, without the previous invocation(s) finishing. Each time I invoke the ThreadFunction, I will be passing it the next chunk of downloaded data. While the download of each chunk and subsequent decompression should take roughly the same time, it probably cannot be guaranteed. With this method, I will NOT be attempting to write the decompressed data to the same file. I am more than happen (and want) the decompressed data from each chunk to be written to different files. 

 

I don't really want to have to write multiple ThreadFunction blocks, each containing the same decompression process and then have to manage distributing the assignment manually.

 

Thank you in advance. 

 

Anand

0 Kudos
Message 1 of 2
(1,766 Views)

Hi Anand,

 

I don't have an answer, but I would assume that you would have to close the thread off before calling it again. I recommend reading through here https://www.ni.com/en-gb/support/documentation/supplemental/06/multithreading-in-labwindows--cvi.htm... and the links at the bottom, it should explain. 

0 Kudos
Message 2 of 2
(1,535 Views)