Jump to content

bna08

Recommended Posts

I am using MoveBlock via Call Library Function to copy a few bytes. The duration of this call measured with two TickCount timestamps in a flat sequence around the call is about 40ms. 

Since MoveBlock should be similar to memcpy in C, I thought it would also perform similarly, however, if it's really this slow, I cannot use it in a meaninful way. 

Has anyone else measured its duration and can you confirm my findings? 

 

Edited by bna08
Link to comment

Your doing it in the UI thread (that would have been my number one guess).   Switching threads is one of the few things that can be multi-millisecond expensive.  Switch the Call to "any thread".

Edit: actually, even a thread switch shouldn't take 40 milliseconds, but give it a try anyway.

Edited by drjdpowell
  • Like 1
Link to comment
On 11/28/2022 at 5:57 PM, drjdpowell said:

Edit: actually, even a thread switch shouldn't take 40 milliseconds, but give it a try anyway.

The thread context switch itself to the UI thread and back again should and won't take that long, it's more in the tenths of microseconds. But that UI thread may be busy doing your front panel drawing or just about anything else that is UI related or needs to run in the only available single threaded protected context in LabVIEW and then the context switch to the UI thread has to arbitrate for it. And that means the LabVIEW code simply sits there and waits until the UI thread finally gets available again and can be acquired by this code clump.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.