No difference between using a local variable and a notifier in timed parallel loops?

The example code "Pass Data With Notifiers.vi" that came with LV 7.1 illustrates using notifiers with parallel loops.  Just looking at two of the loops, the one that generates the sine wave and the one for "User 1", you can change the timing of the two loops and you can change the condition of the "Ignore Previous" status on the "Wait on Notification".  I have a special case of this to consider, where I'm wondering if there's any reason not to use a local variable instead of the notifier:
Set the delay on the generator portion (which contains the Send Notification) to something very short, say 5 ms.  Set the delay on the User 1 (which contains the Wait on Notification) to something relatively longer, say 200 ms.  Set the Wait on Notification to False.  Now you have a situation where the User 1 loop action is contingent only upon the loop delay time, since each time the loop timer runs the loop there will always be a value in the notifier.  In this case it seems to behave just like the case where you update a local variable in the fast loop and read it in the slow one.
Is my understanding correct?  Would there be a performance difference between the two methods?  What do you prefer in this situation and why?
Thanks,
Hosehead

Hi H.,
I think your idea is to write to a Global Variable in the data-producer VI, and read it in the data-consumer VI(?)
One reason this might be less efficient than using Notifiers is if you want to graph every new value in the "consumer" - or make sure the value read in the consumer has changed at least once since the last loop.
> since each time the [consumer] loop timer runs the loop there will always be a value in the notifier...
> Would there be a performance difference between the two methods? 
If you don't use the Notification "event" to synchronize the producer and consumer, then to be sure the consumer gets a new vaue, you've made the producer loop faster - every 5 ms - a waste of cpu-cycles.  More often the situation is reversed, that is, there's a consumer that needs to see every single new value, and (without events) the consumer must loop faster than the producer (to catch every new value) - this is called polling and it wastes cpu-cycles.
Just about anytime one's tempted to make a loop execute "fast" to check on some value (or to make sure there's a fresh value,) there's an opportunity to improve performance through synchronization with events (including notifiers, queues, occurrances, semaphores, and rendezvous')
tbd
Message Edited by tbd on 07-09-2006 03:51 AM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

Similar Messages

  • Difference between use of decision table and if/then in business rules

    Hello ,
    Could some one please explain me difference between use of decision table and if/then in business rules in short.
    - Shirish

    Hi,
    They are equivalent, pretty much what you can do with a decision table you can also do with if/then...
    However, decision tables provide automated features that can reduce the number of required rules, as compared to the if/then rules (this is called rule coalescing).
    Have a look on this document... Search for 5.1.1 What is a Decision Table?
    http://docs.oracle.com/cd/E23943_01/user.1111/e10228/decision.htm#CJHFIAHG
    Cheers,
    Vlad

  • What is the difference between using a global variable,passing a valuee and using a reference?

    I have created a project that consists of several VIs.  Only the main VI has a front panel and the others perform functions.  The function VIs are dependent on controls on the main VI's front panel.  I have several ways of passing the value of the controls.  One is to use a global variable and just place it on the dependent VIs.  Another option is to strictly connect the terminal from the control to a VI connector block and pass the value directly.  My last option is to create a reference of the control and reference it inside the dependent VIs, but this would also require connections to be made to the VI block.
    What are the advantages/disadvantages of these options?
    -Stephen

    5thGen wrote:
    I have created a project that consists of several VIs.  Only the main VI has a front panel and the others perform functions.  The function VIs are dependent on controls on the main VI's front panel.  I have several ways of passing the value of the controls. 
    1) One is to use a global variable and just place it on the dependent VIs.
    2) Another option is to strictly connect the terminal from the control to a VI connector block and pass the value directly. 
    3) My last option is to create a reference of the control and reference it inside the dependent VIs, but this would also require connections to be made to the VI block.
    What are the advantages/disadvantages of these options?
    -Stephen
    1) Globals are evil and introduce race conditions.
    2) The sub-VI only get the value when it was called and updates that occur while the sub-VI is runing are not sensed by the sub-VI
    3) This uses property node "value" or "value signaling" both of which run the user interface thread which is single-threaded and you incur a thread swap hit to performance. You also have a potential for race conditions.
    The are various methods for sharing dat to/from sub-VI which include Queues and Action Engines.
    I hope that hleps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • What is the difference between using the command "dsmgmt" and the "Managed By" tab when adding users to the local administrators Account on a Read-Only Domain Controller?

    When I use the
    "dsmgmt" command to add a user to the local administrators account of a RODC I can actually see the user when I use the "Show Role Administrators" parameter. However, I can't see the members of the
    group added to the "Managed By" tab of the RODC object in AD. Even though, the users added using
    "dsmgmt" and by the "Managed By" tab can all log in locally and have admin rights to the RODC. Are there any differences between these two ways of adding users to the local administrators account? 

    Hi,
    For groups, managedBy is an administrative convenience to designate “group admins”. Whatever principal listed in
    managedBy gets permission to update a group’s membership (the actual security is updated on the group’s AD object to allow this).
    In Win2008 and later managedBy also became the way you delegated local administration on an RODC, allowing branch admins to install patches, manage shares, etc. (http://technet.microsoft.com/en-us/library/cc755310(WS.10).aspx). 
    On the RODC, this is updating the RepairAdmin registry value within RODCRoles.
    So the difference between them should be only the way they do the same thing.
    For more details, please refer to the below article:
    http://blogs.technet.com/b/askds/archive/2011/06/24/friday-mail-sack-wahoo-edition.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • What is difference between using interface as source and table as source?

    I am working on a batch flow which need several steps to populate data from source to target. For example, I need 5 interfaces to finish final data loading. I can either use interface or use temporary table as source and target for the interface 2, 3, and 4. It looks like both case will use tables no matter use interface or use temporary table. So my question is if there is any difference between these two (using interface as source or use temporary table as source)?
    Thanks

    if you use a Table as source for the intermediate process, it will create a physical temporary table i your work rep(depends on you choice) and populate the data into the table. if you use a interface as a source, just it will create a sub query instead of temporary table.
    Thanks
    nidhi

  • What's the difference between using a connection pool and a datasource

    Howdy. I figure this is a newbie question, but I can't seem to find an
    answer.
    In the docs at bea, the datasource docs say
    "DataSource objects provide a way for JDBC clients to obtain a DBMS
    connection. A DataSource is an interface between the client program and the
    connection pool. Each data source requires a separate DataSource object,
    which may be implemented as a DataSource class that supports either
    connection pooling or distributed transactions."
    In there it says the datasource uses the connection pool, but other than
    that, what is the difference between a connection pool and a datasource?

    Thanks for the info. I think it makes some sense. But it's a bit greek.
    I'm sure it'll make more sense the more I work with it. Thanks.
    "Chuck Nelson" <[email protected]> wrote in message
    news:3dcac1f5$[email protected]..
    >
    Peter,
    Here is a more formal definition of a DataSource from the Sun site
    "A factory for connections to the physical data source that thisDataSource object
    represents. An alternative to the DriverManager facility, a DataSourceobject
    is the preferred means of getting a connection. An object that implementsthe
    DataSource interface will typically be registered with a naming servicebased
    on the JavaTM Naming and Directory (JNDI) API.
    The DataSource interface is implemented by a driver vendor. There arethree types
    of implementations:
    Basic implementation -- produces a standard Connection object
    Connection pooling implementation -- produces a Connection object thatwill automatically
    participate in connection pooling. This implementation works with amiddle-tier
    connection pooling manager.
    Distributed transaction implementation -- produces a Connection objectthat may
    be used for distributed transactions and almost always participates inconnection
    pooling. This implementation works with a middle-tier transaction managerand
    almost always with a connection pooling manager.
    Does that help clarify the distinction?
    Chuck Nelson
    DRE
    BEA Technical Support

  • Difference between using the Enterprise Portal and SAP GUI

    Hi Gurus,
    Could one of you please send me a document that lists the differences between the Enterprise Portal and SAP GUI?
    thanks in advance

    Hi,
    For groups, managedBy is an administrative convenience to designate “group admins”. Whatever principal listed in
    managedBy gets permission to update a group’s membership (the actual security is updated on the group’s AD object to allow this).
    In Win2008 and later managedBy also became the way you delegated local administration on an RODC, allowing branch admins to install patches, manage shares, etc. (http://technet.microsoft.com/en-us/library/cc755310(WS.10).aspx). 
    On the RODC, this is updating the RepairAdmin registry value within RODCRoles.
    So the difference between them should be only the way they do the same thing.
    For more details, please refer to the below article:
    http://blogs.technet.com/b/askds/archive/2011/06/24/friday-mail-sack-wahoo-edition.aspx
    We
    are trying to better understand customer views on social support experience, so your participation in this
    interview project would be greatly appreciated if you have time.
    Thanks for helping make community forums a great place.

  • Differences between using a Object Reference and the Object itself

    Example:
    public class Myclass
    //difference between
    Myclass myobj;
    //and
    Myclass myobj = new Myclass();
    can anyone help me?

    Both lines you showed declare an object reference.
    The first one is not explictely assigned a value and
    is thus implicetly assigned the null reference (= a
    reference pointing to no object). The latter is
    initialized with an reference to the newly created
    Object (new Myclass()).
    They're both given a value of null first.
    The second one is then given a value that points to that object that was created.
    If they were inside a method, then the first one's value would be undefined.

  • What is difference between using VIrtual USB port and standard TCP/IP port

    Have a dv6t 2000 laptop and connecting to a photosmart 6150
    Trying to figure out why I have two printer devices installed for the same printer, actually three, one says 6100 series (have to connect to laptop docking station), one says 6100 series 1 (this one i can print to wirelessly) and the last one says 6100 series fax.
    Both the 6100 series and 6100 series 1 only allow me to scan when it is docked but i can print wirelessly to series 1.
    is there a way to scan wirelessly as well.  Allprinters are shared home network.

    Let's handle the easy one first.  The 6100 series fax icon was installed by the HP software as a printer so that you can select that printer from a program.  When you select the 6100 series fax to print to, it sends out that document as a fax skipping the hard copy step of faxing.
    When you look at the icons in the printers folder keep in mind that those are for printing not scanning.  Those icons do not represent a scanner being installed.  It would appear that you have setup the HP software once when docked.  I am assuming that the printer is attached USB to the laptop dock.
    To clear this up, delete the series 1.  That is your network print icon.  Once it is deleted, undock the laptop and then rerun the HP software.  It should come up to a menu where you can select Add a Device.  Go through the network install and it should put a series 1 icon back into the printers folder but also enable scanning over wireless.
    I was an HP employee.
    Please mark the post that solves your problem as "Accepted Solution"

  • Whats the difference between using a .mac account and an AIM account?

    hi, i'm trying to set up ichat to videochat with home when i'm abroad. Will two AIM accounts satisfy or do i have to have a family .mac account? i really dont see the point in paying 200 bucks for the .mac account if you can do the same thing with a free AIM account.
    thanks
    Tom

    Hi
    Either will do for free.
    Free 60day trial(click on free trial on the top) here http://www.apple.com/dotmac/ keep your .mac name after the 60days.
    or free AIM name here http://www.aim.com/ click on "get a screen name"
    Tony

  • Whats the difference betweeen passing the table variable and table valued parameter?

    Hi Everbody
      Can someone one tell me what's the difference between passing a table variable and table valued parameter to a stored procedure or function? Can both be used to pass a table to a stored procedure/function?
    Regards
    Regards

    They are essentially the same. What we call a table variable is a local
    variable. A table-valued parameter is an incoming parameter to the
    procedure. The only difference is that the parameter is readonly.
    When you call a stored procedure, you can pass a table variable as the
    actual parameter. Or a table-valued parameter that you pass on.
    CREATE PROCEDURE nisse_sp @tvp sometype READONLY AS
    DECLARE @local someothertabletype
    EXEC pelle_sp @tvp, @local
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Difference betwn bal in local currcy and account currency

    hi all,
    can any one explain difference between balance in local curreny and account currency.and to which accounts we have to select

    Account currecny: Consider this example: You have defined your company code in India and the currency will be in that case INR. So the account currency by default is INR. In that case for this GL account you can post in all currencies.
    You have a foreign currency account say in USD. Then you can define this account currecny as USD. So when you define this account USD, you can post only in USD and not in anyother currency and the system automatically translate into INR.
    Balance in local currency:
    This indicator is set for clearing accounts you use to clear line items in various currencies with one local currency amount and without posting any exchange rate differences that may occur.
    This indicator is set  for the following accounts:
    Cash discount clearing accounts
    Clearing accounts for goods receipt / invoice receipt

  • What is difference between local variable and property node ?

    What is difference between local variable and property node ?
    " 一天到晚游泳的鱼"
    [email protected]
    我的个人网站:LabVIEW——北方客栈 http://www.labview365.com
    欢迎加入《LabVIEW编程思想》组——http://decibel.ni.com/content/groups/thinking-in-labview

    To make things clear, here are two small examples that show how nasty locals and value properties can be to the naive programmer.
    - Open the diagram of the race condition.vi before running it and try to predict what will be the values of the two counters after the third run.
    - Use the Compare Locals Properties and Wires.vi to find out how slow locals and value properties can be (times 1000+).
    This being demonstrated, I must add that I use globals and value properties quite often, because they are often very convenient
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        
    Attachments:
    Race condition.vi ‏9 KB
    Compare Locals Properties and Wires.vi ‏18 KB

  • Difference between use of IS and AS while creating a Package or Procedure

    Hi,
    Had an interview in one of the company.
    They asked me this, "What is the difference between using IS and AS while creating Package or Stored Procedure ?".
    I checked creating package with same IS and AS, but there is no issues.
    Kindly clarify me on this.
    Lots of thanks in advance.
    Regards,
    Shiva

    >
    Had an interview in one of the company.
    They asked me this, "What is the difference between using IS and AS while creating Package or Stored Procedure ?".
    >
    Quite frankly my first response to them would be: why do you even care?
    That would be quickly followed by: do you have any meaningful questions you would like to ask? Perhaps something that might actually be relevant to what you do here?
    I personally don't care if someone has memorized the syntax required to create DDL/DML. I care whether they know how and when to use it.
    Check the docs for the syntax diagram and from at least 9i on it will be similar to this from 9i
    http://docs.oracle.com/cd/B10501_01/appdev.920/a96624/08_subs.htm
    >
    A procedure is a subprogram that performs a specific action. You write procedures using the syntax:
    [CREATE [OR REPLACE]]
    PROCEDURE procedure_name[(parameter[, parameter]...)]
    [AUTHID {DEFINER | CURRENT_USER}] {IS | AS}
    [PRAGMA AUTONOMOUS_TRANSACTION;]
    [local declarations]
    BEGIN
    executable statements
    [EXCEPTION
    exception handlers]
    END [name];
    >
    Here is the link for 11g
    http://docs.oracle.com/cd/B28359_01/appdev.111/b28370/create_procedure.htm
    Note that the syntax for some objects requires one or the other and will not accept both.
    >
    CURSOR x IS ...
    TYPE x IS ...
    SUBTYPE x IS ...
    CREATE TABLE x AS subquery
    SELECT x AS "y" FROM z AS "w"
    WITH x AS (SELECT ...

  • Difference between using app server connection pooling and using the driver

    Hi all,
    How to get connection pooling with out application server and tomcat also?
    What is the difference between using app server connection pooling and using the driver supported connection pooling?
    Regards,
    Murali

    maybe the performance of App server pool is better than the JDBC pool,
    for you don't know wether the implementation of the JDBC interface is good or bad.

Maybe you are looking for

  • With holding tax base amount for 1099 vendors with discounted payment term

    Hi Friends, We have a below situation for 1099 vendors, Some of the 1099 vendors are set-up in the system with payment term with discounts i.e. 2% if paid within 10 days As per config, system posts with holding tax base amount at the time of posting

  • Loop through contents of textarea / arrays in PL/SQL?

    Hi all, I have the need to allow a user to update a large number of rows at once. His data source is a spreadsheet. Basically, he receives a file weekly that contains dozens of vehicle numbers and dates that they are to be delivered. My thinking is t

  • How to deactivate the vendor master workflow???

    hi I need info about how deactivate the vendor master workflow? do we have any Transaction Code for that?

  • A way to find my previous questions and problem reports?

    Is there a way on this forum to find my previous questions and problem reports? Since posting a question earlier today, I've found MOST of the answer and would therefore like to append what I found to the question, without waiting for someone else to

  • Finder Lags Until Time Machine Drive RPM Increase

    Example.    In a FInder window I click on Today and the list of files modified today will not appear until the time machine drive gets up to speed.  I can hear the drive start to spin when I click on Today, and when the drive gets up to a certiain sp