AnsweredAssumed Answered

Hogging CPU time

Question asked by VRFuser on Feb 4, 1998
When I need to do this, I set a global variable.  Then use an ON
     CYCLE into an IF THEN ELSE box.  If the global is set appropriately,
     then the thread is activated, otherwise, the loop stalls for the CYCLE
     time, then checks again.  In your User input thread, you have a button
     that will set the global to activate the measurements.  I have also
     done this where the opposite state of the global activates the User
     Input thread in the same manner.  That way, the user input is not
     allowed whiile making a measurement (you don't want them in there
     rearranging instrument settings in the middle of your acquisition),
     and having a STOP MEASUREMENT button to change the state of the global
     and end the measurement thread manually.
       Hopefully that gets the idea across.....
       You can also have any number of threads running like this, with a
     control input that will activate the appropriate thread as needed. 
     One note: Keyboard and Mouse interrupts will interfere with a parallel
     thread.  One way around this is to set the measurement activity in a
     client program and use I/O to SOCKETS to communicate and control the
     parallel activities.  There is an example in the manuals that shows
     how this is done.  We have had to use this to make sure that
     instrument input buffers are not overrun because the user is "sitting"
     on the mouse button .
     Thomas Groleau
     RMSC  Tucson, Arizona

______________________________ Reply Separator _________________________________
Subject: Hogging CPU time
Author:  Curt Peterson <> at CCGATE
Date:    2/4/98 12:35 PM

Does anyone know of a way that I can have Vee sleep periodically when it is just
running a specific thread.  Here is the problem.  I have two threads (UNTIL
BREAK loops) one for measurements and one for user interface components.  When
the program is waiting for user input I would rather it not take all the CPU
time.  Any thoughts??
Curt Peterson
<color><param>0000,0000,ffff</param>QUALCOMM</color> Inc.              
</paraindent>6455 Lusk Blvd.       (619) 651-3814 wk. ph.
San Diego CA 92121              (619) 636-9447 alpha pager