Is this roughly how the labVIEW Execution Systems work?

I've not taken a class in OS design, so I don't know the strategies used to implement multitasking, preemptive or cooperative. The description below is a rough guess.
LabVIEW compiles Vis to execute within its own multitasking execution environment. This execution environment is composed of 6 execution systems. Each execution system has 5 priority queues (say priorities 0->4). Vis are compiled to one or more tasks which are posted for execution in these queues.
An execution system may either have multiple threads assigned to execute tasks from each priority queue, or may have a single thread executing all tasks from all priority queues. The thread priorities associated with a multithreaded execution system are assigned according to the queue that they service. There are therefore 5 available thread priority levels, one for each of the 5 priority level queues.
In addition to the execution queues, there are additional queues that are associated with tasks suspended in various wait states. (I don't know whether there are also threads associated with these queues. It seems there is.)
According to app. note 114, the default execution environment provides 1 execution system with 1 thread having a priority level of 1, and 5 execution systems with 10 prioritized threads, 2 threads per priority queue. NI has titled the single threaded execution system "user interface" and also given names to the other 5. Here they will be called either "user interface" or "other".
The "user interface" system is responsible for all GUI actions. It monitors the keyboard and mouse, as well as drawing the controls. It is also used to execute non-thread-safe tasks; tasks whose shared objects are not thread mutex protected.
Vis are composed of a front panel and diagram. The front panel provides an interface between the vi diagram, the user, and the calling vi. The diagram provides programmatic data flow between various nodes and is compiled into one or more machine coded tasks. In addition to it own tasks, a diagram may also call other vis. A vi that calls another vi does not actually programmatically branch to that vi. Rather, in most cases the call to another vi posts the tasks associated with the subvi to the back of one of the labVIEW execution system�s queues.
If a vi is non-reentrant, its tasks cannot run simultaneously on multiple threads. This implies a mutex like construction around the vi call to insure only one execution system is executing the vi. It doesn�t really matter where or how this happens, but somehow labVIEW has to protect an asynchronous vi from simultaneous execution, somehow that has to be performed without blocking an execution queue, and somehow a mutex suspended vi has to be returned to the execution queue when the mutex is freed. I assume this to be a strictly labVIEW mutex and does not involve the OS. If a vi is reentrant, it can be posted/ran multiple times simultaneously. If a vi is a subroutine, its task (I think there is always only one) will be posted to the front of the caller's queue rather than at the back of the queue (It actually probably never gets posted but is simply mutex tested at the call.) A reentrant-subroutine vi may be directly linked to its caller since it has no restrictions. (Whether in fact labVIEW does this, I don�t know. In any event, it would seem in general vis that can be identified as reentrant should be specified as such to avoid the overhead of mutexing. This would include vis that wrap reentrant dll calls.)
The execution queue to which a vi's tasks are posted depends upon the vi execution settings and the caller's execution priority. If the caller's execution priority is less than or equal the callee's execution settings, then the callee's tasks are posted to the back of the callee's specified execution queue. If the caller's execution priority is greater than the callee's specifications, then the callee's tasks are posted to the back of the caller's queue. Under most conditions, the vi execution setting is set to "same as caller" in which case the callee�s tasks are always posted to the back of the caller's execution queue. This applies to cases where two vis are set to run either in the other execution systems or two vis are set to run in the user interface execution system. (It�s not clear what happens when one vi is in the �user interface� system and the other is not. If the rule is followed by thread priority, any background tasks in the �other� systems will be moved to the user interface system. Normal task in the �other� systems called by a vi in the �user interface� system will execute in their own systems and vice versa. And �user interface� vis will execute in the caller�s �other� system if the caller has a priority greater than normal.)
Additionally, certain nodes must execute in the "user interface" execution system because their operations are not thread-safe. While the above generally specifies where a task will begin and end execution, a non-thread safe node can move a task to the �user interface� system. The task will continue to execute there until some unspecified event moves it back to its original execution system. Note, other task associated to the vi will be unaffected and will continue to execute in the original system.
Normally, tasks associated with a diagram run in one of the �other� execution systems. The tasks associated with drawing the front panel and monitoring user input always execute in the user interface execution system. Changes made by a diagram to it own front panel are buffered (the diagram has its own copy of the data, the front panel has its own copy of the data, and there seems to be some kind of exchange buffer that is mutexed), and the front panel update is posted as a task to the user interface execution system. Front panel objects also have the advanced option of being updated sequentially; presumably this means the diagram task that modifies the front panel will be moved to the user interface execution system as well. What this does to the data exchanged configuration between the front panel and diagram is unclear as presumably both the front panel and diagram are executing in the same thread and the mutex and buffer would seem to be redundant. While the above is true for a control value it is not clear whether this is also true for the control properties. Since a referenced property node can only occur on the local diagram, it is not clear it forces the local diagram to execute in the user interface system or whether they too are buffered and mutexed with the front panel.
If I were to hazard a guess, I would say that only the control values are buffered and mutexed. The control properties belong exclusively to the front panel and any changes made to them require execution in the �user interface� system. If diagram merely reads them, it probably doesn�t suffer a context switch.
Other vis can also modify the data structure defining the control appearance and values remotely using un-reference property nodes. These nodes are required to run in the user interface system because the operation is not thread-safe and apparently the diagram-front-panel mutex is specifically between the user interface execution system and the local diagram thread. Relative to the local diagram, remote changes by other vis would appear to be user entries.
It is not clear how front panels work with reentrant vis. Apparently every instance gets its own copy of the front panel values. If all front panel data structures were unique to an instance, and if I could get a vi reference to an instance of a reentrant vi, I could open multiple front panels, each displaying its own unique data. It might be handy, sort of like opening multiple Word documents, but I don�t think that it�s available.
A note: It is said that the front panel data is not loaded unless the front panel is opened. Obviously the attributes required to draw an object are not required, nor the buffer that interfaces with the user. This rule doesn�t apply though that if property references are made to front panel objects, and/or local variables are used. In those cases at least part of the front panel data has to be present. Furthermore, since all data is available via a control reference, if used, the control�s entire data structure must be present.
I use the vi server but haven�t really explored it yet, nor vi reference nodes, but obviously they too make modifications to unique data structures and hence are not thread-safe. And in general, any node that accesses a shared object is required to run in the user interface thread to protect the data associated with the object. LabVIEW, does not generally create OS level thread mutexes to protect objects probably because it becomes to cumbersome... Only a guess...
Considering the extra overhead of dealing with preemptive threading, I�m wondering if my well-tuned single threaded application in LV4.1 won�t out perform my well-tuned multithreaded application in LV6.0, given a single processor environment�
Please modify those parts that require it.
Thanks�
Kind Regards,
Eric

Ben,
There are two types of memory which would be of concern. There is temporary and persistent. Generally, if a reentrant vi has persistent memory requirements, then it is being used specifically to retain those values at every instance. More generally, reentrant code requires no persistent memory. It is passed all the information it needs to perform its function, and nothing is retained. For this type of reentrant vi, memory concern to which you refer could become important if the vis are using several MBytes of temporary storage for intermediate results. In that case, as you could have several copies executing at once, your temporary storage requirements have multiplied by the number of simultaneous copies executing. Your max memory use is going to rise, and as labview allocates memory rather independently and freely, the memory use of making them reentrant might be a bit of a surprise.
On the other hand, the whole idea of preemtive threading is to give those tasks which require execution in a timely fashion the ability to do so regardless of what other tasks might be doing. We are, after all, suffering the computational overhead of multithreading to accomplish this. If memory requirements are going to defeat the original objective, then we really are traversing a circle.
Anyway, as Greg has advised, threads are supposed to be used judiciously. It isn't as though your going to have all 51 threads up at the same time. In general I think, overall coding stategy should be to minimize the number of threads while protecting those tasks that absolutely require timely execution.
In that sense, it would have been nice if NI had retained two single threaded systems, one for the GUI and one for the GUI interface diagrams. I've noticed that control drawing is somewhat slower under LV6.0 than LV4.1. I cannot, for example, make a spreadsheet scroll smoothly anymore, even using buffered graphics. This makes me wonder how many of my open front panel diagrams are actually running on the GUI thread.
And, I wonder if threads go to sleep when not in use, for example, on a wait, or wait multiple node. My high priority thread doesn't do a lot of work, but the work that it does is critical. I don't know what it's doing the rest of the time. From some of Greg's comments, my impression is it in some kind of idle mode: waking up and sleeping, waking up and sleeping,..., waking up, doing something and sleeping... etc. I suppose I should try to test this.
Anyway that's all an aside...
With regard to memory, your right, there are no free lunches... Thanks for reminding me. If I try this, I might be dismayed by the additional memory use, but I won't be shocked.
Kind Regards,
Eric

Similar Messages

  • How the performance appraisal system works in SAP...

    HI all,
    Plz guide me for a demo presentation for a client ...where they are required a performance appraisal for a service industry...plz consider 360 degree appraisal process....rating system...rating weitage as per reporting structure..(his immegiate boss will have 50% weitage and rest subordinate and peers will have remaining 50%) this is an example....
    Thanks,
    Amol

    Hello,
    This is finance forum.
    You better post this question in HR forum.
    Regards,
    Ravi

  • When I insert a photo from iPhoto into my iMovie, the photo that appears in the movie is different from the one that I inserted - why is this and how can I make it work properly?

    When I insert a photo from iphoto into imovie, the photo that appears is different from the one that I inserted.  Why is this and how can I make it work properly?

    WHat version of iMovie, and iPhoto?
    THIs forum is for iMovie iOS (iPads, iPhones).
    Are you talking about iMovie for Mac?

  • I had a Tascam US 122 usb interface, but it didn't work with OSX Mavericks. What model would work with this? Would the US-144 mkii work with my system?

    I had a Tascam US 122 usb interface, but it didn't work with OSX Mavericks. What model would work with this? Would the US-144 mkii work with my system?
    Thanks!

    You didn't mention the kind of track in GB you are trying to create, but if you are connecting the keyboard with a guitar chord to the Tascam, you will need to set up a Real Instrument Track in GB to hear anything. If your keyboard has a midi out, use a midi cable to the midi input of the Tascam, create Software Instrument Track, and you will hear something. But with a guitar chord, it won't send the right signal to a Software Instrument Track. The headphone jack in the Tascam monitors the signal coming back to it out of GB (if you choose the US-122 as your monitor in GB's preferences), so you wouldn't hear your keyboard if the track is not set up correctly. It could be the drivers, but since you didn't mention the type of keyboard or the type of GB track, I thought that might be a possible answer as well.
    eMac   Mac OS X (10.3.8)  

  • Spell Check in New Forums- How The Heck does it work?

    Can somebody please tell me how the spell check works in this new forum format? I click on the abc icon and it does nothing. I do a two finger click on a word that is misspelled and it give me Insert Options. I really like the new format but hate the spell check. Can anyone offer advise? Thanks.

    The built-in ASC spell checker is -- to put it kindly -- quirky. First, you must turn it on using the 'abc' tool on the right in the editor toolbar. (When it's on, it highlights.) But it won't stay turned on if you click on the tool before you enter any text -- it will just tell you that no misspellings were found & won't stay on. It also sometimes fails to check the last word if followed by a space. You can tell it to ignore misspellings, but you can't tell it to learn words because the spell-checking dictionary is actually on the servers running the site, not on your Mac or PC.
    But from your remarks, you probably aren't even using the built-in checker. Instead, I suspect you are trying to use the far superior system-wide one built into OS X. The problem with that is the ASC editing tools are powered by Javascript supplied by the Jive SBS software running the site. Because that is platform independent it doesn't know anything about OS X's contextual menu (which includes suggestions for misspellings, the Dictionary lookup, & so on).
    So to make a long story short, what happens when you try to right click on a word the OS X checker has underlined in red, instead you get the Javascript's response to a right click, which brings up the editor's insert/alignment popup menu instead of the OS X contextual menu.
    The solution is to control click on the word -- believe it or not, within the ASC editor window a right click & a control click are not the same thing! You literally have to hold down the control key on the keyboard when you click to bypass the Javascript's right click response.
    To make things that much more confusing, this only applies if the pointer is not over empty space in the editor window, which in this case excludes lines that have any text on them, including invisible text like spaces or returns. (To see what I mean, drag the tab at the bottom right of the editor window down so there is a lot of empty space below what you have typed. In this empty area, right & control clicks both bring up the OS X contextual menu, but anywhere in the text you have typed, they behave differently.)
    In short, the problem is not that Apple has changed how the buttons or clicks work, it is that the new software that runs the site (not developed by Apple) does.
    Hope this helps.

  • How the Sun Java Forums Work (Briefly)

    I am wondering if anyone could give me a brief overview of how the Java sun forums work -- esp. when someone creates a new thread.
    How exactly does the JSP know to link to that thread? Is it generating a unique ID from the database or using it's own custom code? How does it point to that thread? (I'm SO FRUSTRATED. I've tried to figure this one out for about a MONTH.)
    I've started to create a help desk, where it takes form data and posts it to the database. (That issue solved.) The database assigns it a unique ID -- primary key. I'm having trouble displaying the problem record for that ticket ID. (I'm new to Java and really been pulling my hair over this one for about a month.)
    Let me go into some more detail:
    I have these form objects:
    - Name
    - Technical Summary
    - Severity
    - Problem
    This is a standard html form page. The standard html page posts to a JSP page, where the JSP page uses a prepared statement to insert the form data into the database. The query page, (query.jsp) has a table, which only shows TicketID, Name, Technical Summary, and Severity. Obviously, the TicketID is an int and generated by the DB, as 1, 2, 3, 4, and so on...
    So if someone created an issue it'd be assigned a unique ticket id. Note that from the query page, it DOES not show the problem. I WANT there to be a link to get the problem record in that row.
    If anyone could help me out with this one, that would be great.

    Below is the CORE JSP Query Code. Obviously, I did NOT post the HTML b/c that would look **REALLY** weird. Any help on resolving my problem, would relly be helpful! Please hep! :)
    <%@ page import="java.sql.*"%>
    <%
    String first_name = user.getFirstName();
    String last_name = user.getLastName();
    %>
    <%
    String userid = user.getUserId();
    %>
    <%
    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;
    try {
    Class.forName ("com.mysql.jdbc.Driver");
    conn = DriverManager.getConnection( "jdbc:mysql://localhost:3306/helpdesk", "root", "password" );
    stmt = conn.createStatement ();
    rs = stmt.executeQuery ("SELECT * FROM history WHERE userid = '"+userid+"' ");
    %>
    <% while( rs.next() ){%>
    <%
    int ticketid = rs.getInt("ticketid");
    String technical_subject = rs.getString("technical_subject");
    session.setAttribute("technical_subject", technical_subject);
    %>
    <TR>
    <TD width="76" align="center">
                   <font face="Arial" style="font-size: 8pt"> <%out.println(ticketid);%> </font></TD>
                   <TD align="center" width="131">
                   <font face="Arial" style="font-size: 8pt"> <%=rs.getString("severity")%> </font></TD>
                   <TD align="center">
                   <font face="Arial" style="font-size: 8pt"> <%=rs.getString("issue_type")%> </font></TD>
                   <TD align="center">
                   <font face="Arial" style="font-size: 8pt"> <%out.println(technical_subject);%> </font></TD>
                   <TD align="center">
                   <font face="Arial" style="font-size: 8pt; font-weight: 700">View
                   Complete Issue</font></TD>
    </TR>
    <%}%>
    </TABLE>
    </BODY>
    </HTML>
    <%
    }catch
         (Exception e){
    out.println("There was an exception. Stack trace will be printed to the error log.");
    e.printStackTrace();
    System.out.println ("A fatal exception occured when fetching the database results. See the stack trace error for more information. Verify you are requesteting the correct data type");
    }finally{
    //this is important. You should close all three to free up resources. Always. In a finally block.
    rs.close();
    stmt.close();
    conn.close();
    %>

  • I have seen on this community that the earpods do not work on iPod shuffle gen 3 but when I was using on them it worked the control panel thing that is but only until I turned it off I don't understand why it won't work again and why it did in the first p

    I have seen on this community that the earpods do not work on iPod shuffle gen 3 but when I was using on them it worked the control panel thing that is but only until I turned it off I don't understand why it won't work again and why it did in the first place can someone please explain and tell me how to make it work again

    Sorry first time asking question didn't mean to write same thing twice well copy paste

  • HT1923 This article contains the only thing that worked for me.  I also had to sign out of iCloud and uninstall it.  Then I had to delete all files and folders from all of those applications that were under Program Files, Program Files x86, and Users.

    This article contains the only thing that worked for me.  I also had to sign out of iCloud and uninstall it.  Then I had to delete all files and folders from all of those applications that were under Program Files, Program Files x86, Program Data and Users.  My iPhone 4 will now sync with iTunes both in its USB-connected  mini dock and over Wi-Fi.  It's unfortunate (negligent programming on the part of Apple?) that the upgrade to iTunes 11 did not remove all of those files as part of the upgrade process. 

    I am having the same issue....Same address for years - same as USPS - I tried 5 times (3 macs and 2 iPhones) and now i have 5 CHARGES for 1.00 each on my credit card. I took the credit card info off so they don't charge me anymore. How can they charge me yet still not allow me to download free updates and say I have an invalid address? I'm sure I will spend weeks or months trying to get a credit out of these incompetent idiots.

  • How the Drill down functionality works if the source is Bex Query

    Dear All,
    How the Drill down functionality works if the source is Bex Query through the query browser in Dashboard 4.1
    Please let me know process.
    Thanks
    Regards,
    Sai

    Hi sai,
    Drill down can be done by two ways.
    1. you need to bring all the data in one shot to the spreadsheet and then by using the components you can achieve it. Below given link explains in detailed about that.
    Filtering Through Combo Box
    2. you can use different set of query to pass the value from one set to another to fetch the data using the prompt. please check the below which explain them.
    Difference between "When value Becomes & When value Changes"
    Revert any clarification required on this.
    --SumanT

  • How the stock determination process works

    Hi All
    Can any one tell me how the stock determination process works in inventory management?
    if possible give me the steps involved in stock determination process .
    Regards
    M S K

    Hi
    i hope this helps
    http://help.sap.com/saphelp_47x200/helpdata/en/d8/2f3746996611d1b5480000e82de955/frameset.htm
    regards
    maniraj

  • TS3694 I performed an iOS 7 software update on my iPhone yesterday, and now the phone is not working at all. The iPhone screen shows to connect to iTunes to restore. I've have done this, and still the iPhone is not working. What going on?

    I performed an iOS 7 software update on my iPhone yesterday, and now the phone is not working at all. The iPhone screen shows to connect to iTunes to restore. I've have done this, and still the iPhone is not working. What going on?

    I have no idea what may have caused your MacBook to stop working, but from your description it kind of sounds like it may have started before you ran Software Update and installed the new Apps. Just the general slow feeling and bugginess is what tips me off. You said that you weren't sure if you had closed all open windows, that doesn't matter if the computer restarts itself. It automatically closes all other open applications when restarting.
    As to your data being retrievable, if when you take it in they do a fresh install of the OS, then no, it will not be unless you want to pay several thousand dollars to a software retrieval company.
    I am glad to hear that you have taken into the Apple Store to get it fixed, and that you have all of your purchased music backed up to your iPod. You should be able to just transfer it all back to iTunes once you get your computer back should it be necessary.
    As a side note, the proper place for this topic would probably in the MacBook forums, not iTunes since there is no evidence that iTunes started the issue.

  • How the below query is working

    Hi,
    I am newly joined in the group.
    the emp table has 5 rows as below
    100     ram     10000.00     10
    200     kumar     15000.00     10
    300     william     20000.00     10
    400     ravi     25000.00     10
    500     victor     30000.00     10
    i execute the below query
    select ename,sal from emp_test where case when sal < 10000 then sal + 1000
    when sal < 20000 then sal + 2000
    else sal
    end < 20000
    it gives the below output
    ram     10000.00
    kumar     15000.00
    How the above query is working?
    Please explain. thanks in advance

    If you want it to show the changed salary, it has to be in the select line not the where:
    select ename,
           (case when sal < 10000 then sal + 1000
               when sal < 20000 then sal + 2000
               else sal
            end) sal from emp_test
    where  case when sal < 10000 then sal + 1000
               when sal < 20000 then sal + 2000
               else sal
            end < 20000

  • HT4528 icloud says maximum number of free accounts for this iphone  how can i make it work?

    icloud says maximum number of free accounts for this iphone  how can i make it work?

    You have created too many accounts. There's no way to get around this.

  • How would I set the LabVIEW Execution Display.vi to automatically run a sequence from a desktop icon or the Start Menu Launcher.vi

    LabVIEW does not support command line arguments. Are there some modifications to the Execution Display.vi that would enable this behavior?

    Hi,
    This mods is to the LabVIEW OI supplied with TS2.0.1 and labVIEW 6.1
    In the TestStand - Runtime Operator Interface.vi, the cmdline is obtained and the full path to the sequence file is stored in a global variable. When the Sequence Display is launched and the case First Time is executed. The cmd line global is checked for an empty string, if its not then the string is concatated with the string 'Open Sequence File - No Prompt|' and put on the message queue. This will result in the sequence file being opened.
    The cmd line parsing is pretty basic. the argument is nothing or the full pathname to the sequence file.
    If this is what you are after then send your email to [email protected]
    I tried to attach the vi's but I am having some problems with thi
    s. Probably a size restriction.
    Hope this helps.
    Ray Farmer
    Regards
    Ray Farmer

  • Configure the priority/execution system of Sub-VIs

    Hi,
    I wonder if it is possible to configure a VI to run with different priorities or in different execution systems when called on different occations. It seems to me that the only way to influence this is by changing the properties of a VI and then saving it. That would leave me having n just slightly different VIs for n settings.
    Sören

    Hello,
    VI server exposes properties which allow you to change the priority and execution of a VI dynamically.  However, these properties cannot be set while the VI is running, and therefore a VI cannot set its own priority or execution system.  This means that you have to use a plug-in architecture (dynamically called VIs) in order to dynamically choose the priority and execution system of VIs.  I've attached a short example written in LV 7.1.  If you are unfamiliar with VI server or dynamically calling VIs, the LabVIEW Intermediate II course covers these topics and I'm sure there is also plenty of good content on these forums and in the developer zone.
    Regards,
    Ryan K.
    Note:  You should be careful when adjusting the priorities and execution systems on a VI, as you can often end up with undesired results due to priority inversion.
    Attachments:
    Priority Demo.zip ‏20 KB

Maybe you are looking for

  • PO Creation date in display mode during ME21N

    Dear Sir, Pl. lnform me that how PO creation date i.e. document date to be make in display mode so that user should not be able to change the default date at the time of creation of PO. Thanks & Regards, Rajiv Saxena

  • HP 250 G1 i can`t use N wireless speeds

    Hello i have strange problem with my laptop.. my laptop have ralink wireless adapter. My router is d-link 615 and support 300Mbps. What i found today is , i`m connected to router with Wireless-G (54 Mbps)  from my laptop but ralink suppor Wireless-N

  • Calling a SP or Function from Java receiving a geometry(MDSYS.SDO_GEOMETRY)

    Hi there, What I want to do is: calling a stored procedure OR function from Java with a String-variable as input and receiving a geometry (SDO_GEOMETRY). I’m facing currently the problem of calling a stored function on oracle 11g from Java using JPA

  • Installing adoble reader 9.3.4

    Access is denied. File: D:/Documents and Settings/Administrator/Local Settings/Application Data/NOS/nos01692//nos1E8.tmp why i get this error at 69% installed? and btw i checked that folder and i dont have that file (nos1E8.tmp) help.....

  • Internet browser not supported

    Hi. Unfortunately at the moment i have to use my 8120 for internet access. NatWest's online banking website comes up with an error message 'online banking does not support your internet browser'. Would anyone know if i could download a compatible bro