10-06-2016 03:41 AM
I ran into the situation recently that an occurrence was invalid, and the loop waiting for this occurrence didn't handle the timeout. This causes 37% CPU load on my 8-core machine (i.e. equivalent of 3 cores being fully utilized). This seems surprising, since usually a single loop will run in one thread and thus cannot use more than one CPU core.
I created a very simple test VI which shows the same behavior.
Running this VI on a multi-core CPU fully utilizes 3 CPU cores (on my machine).
Using Performance Monitor shows that this simple VI uses several threads.
Doing the same test with a notifier instead of an occurrence uses only 1 thread (and thus utilizes 1 CPU core).
Any idea what is happening here? How can this loop fully utilize 3 cores?
10-06-2016 04:59 AM
10-06-2016 05:21 AM
Yeah we're moving away from using occurrences slowly.
But probably it helps to detect the implementation bug, with a notifier only 1 core would have been maxed out.
Just for completeness, queues also show the expected behavior, maxing out 1 core.
I'm curious how the occurrence loop can max out 3 or 4 cores. Must be heavily parallelized internally