What is the Fastest producer consumer method. Queue, RT-FIFO, Event

Hi all,
Another curly question for the pro's:
I have recently inherited some labview code that uses RT-FIFO for the transfer mechanism in the producer consumer architecture.
The code was first written 3-4 years ago and is presently in LV8.6. It is possible that the reasons for the architectural decision no longer exists.
I am skilled using a queued producer consumer architecure,
I understand the RT-FIFO Architecture.
I have begun using a user Event Based architecture.
(I have attached samples of each)
I also see the existance of a priority Queue
Each method has it's own capabilities and deficiencies, That aside, does anyone know the relative performance of each method.
(Assuming single process)
I would expect RT-FIFO to be fastest, it appears to be a low feature version of a standard queue.
What is the perfornace hit for using a more coding freindly Queue
The RT-FIFO description speaks of commications between time critical and lower priority threads.
Until today, I believed that Queues had the same capability.
I have included an event method I commonly use for peer review and to help to fellow users..
It allows:
1. Multiple producers with different data types
2. Processes repecting order of production.
3. Allows for asynchronus checking of functional notifiers such as stop, start and abort.
4. In a non real time system it can include front panel interactions.
What I don't understand about it is what overheads, or thread priority changes that may be experienced by using this architecture (it solves a lot of problems for me).
Thanks in advance,
iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
Solved!
Go to Solution.

Are you running into a situation where the difference in time between producing an event, and consuming it, is actually causing your problems?  If not, this is not a question worth worrying about.  Use whatever is most appropriate for your application.
There's no need to make wild guesses - build a VI, benchmark and test!  The attached is a reasonable starting point, although I think the event structure may be slow due to setup time but may respond quickly once running.  If you experiment with this, you'll probably find that there's no definite answer to which is fastest.  Changing the size of the RT-FIFO, or of the queue, makes a big difference in speed.  At least in my testing, a single-element RT-FIFO is fastest, but an infinitely large queue is faster than a small queue, and a longer RT-FIFO is much slower than the single-element version.
It's important to realize that RT is not another word for Fast or Efficient, it's another word for Consistent.  For the purposes of real-time (deterministic) execution, it doesn't matter how fast the RT-FIFO functions are so long as they execute in exactly the same amount of time, every time (with the exception of a "forever" timeout value, of course).  You can use either a standard queue or an RT-FIFO to communicate between loops.  One use for an RT-FIFO is when a time-critical loop is enqueuing the data.  It guarantees that the amount of time needed to put data into the FIFO will not vary.  Enqueueing data in a standard queue will sometimes be faster than other times, depending on whether there is already space available in the queue or space needs to be allocated for the new element.  If this variation is unacceptable, then use an RT-FIFO; otherwise, the standard queue works just as well.
If the architecture shown in your image is working for you, I don't see any reason to change it.
EDIT: oops, almost forgot to attach the code I used for testing!
Attachments:
Event vs Queue.vi ‏21 KB

Similar Messages

  • What is the fastest way to pass data between parallel threads?

    I have a top level vi running with 6 parallel threads. I need to pass some data from digital I/O to several of the threads. What is the fastest responding way to do this. I am controlling a machine that has quite a few sensed events happening at very close intervals, some as close together as 1 to 2 milliseconds, and I seem to be randomly missing the signal from these sensors. How can I distribute the I/O to the different threads and not miss any inputs?

    I usually use a Queue to pass data from one loop to another. Other
    choices are Functional Globals or Notifiers. It kind of depends on what
    you need to do as to which one is best, so it's a bit hard to recommend
    one over the others without knowing more about your application.
    Both Queues and the Functional Globals (if written correctly) can
    buffer data so you're less likely to lose data if one loop gets behind
    the others.
    Ed
    Ed Dickens - Certified LabVIEW Architect - DISTek Integration, Inc. - NI Certified Alliance Partner
    Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.

  • What is ment by 'producer/​consumer approach'?

    What is ment by 'producer/consumer approach'?How would I implement into the program shown in the screenshot below?
    Cheers
    Sam 
    Attachments:
    wind5.png ‏91 KB

    In your program the DAQ and IO assistances would be the producers, and the filewriting would be the consumer. 
    Look here for more info.

  • I want to transfer all my iPhoto, iTunes, contacts, etc. files from my MacBook, which I am selling to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine be transferred to the Pro?.

    I want to transfer all my iPhoto, iTunes, contacts,documents, etc. files from my MacBook, which I am selling, to a MacBook Pro. What is the easiest and safest method of achieving this? Can the files backed up on Time Machine from the MacBook be transferred to the Pro in some way? I would like to capture the files as they appear on the MacBook, such as "Events" in iPhoto and the various song categories within iTunes without having to rename them all once saved on the Pro, which is the case with photos when I simply save them to thumb drive and import them to the Pro. Sny advice would be appreciated.
    Best regards,
    Rob.

    Michael,
                 Thanks for all your assistance. There is no need for apologies, Migration Assistant did indeed create a second account for the MacBook data. It has just taken me some time to figure out how to access it. I now have all the MB data in one account and the MBP files in another, which suits me fine. In fact, it is an advantage in my case as it keeps the private and business aspects separated.
    I will however try the fatcatsoftware to transfer all the iPhoto files to my iMac, where I keep my main photo library. and it will be of help to keep the events, etc in the transfer. As far as iTunes is concerned, I have HomeSharing on all my computers and this has obviated the need to worry about playlists being transferred successfully. However, HomeSharing did not appear to share the iPhone/iPod apps that were stored on the MB and although these have now come across with the new MacBook account on the MBP, I was wondering whether my iPhone and iPod will be recognised by the MBP and sync with it? Will I need to have the MB account open to achieve this or will the MBP recognise and sync with the iPhone/iPod automatically irrespective of which account is open?
    Thanks for the tip on deauthorising my iTunes account from the MB before sellng. This I will do and I believe the best way to remove all of my data from the hard drive is to reinstall the MacOSX operating system software. Is this the right approach to securely delete everything?
    Thanks again for sharing your expertise and your guidance through this exercise.
    Best regards,
    Rob.

  • What is the fastest CPU I could put in Satellite Pro L20

    This is a desperate request for help!!
    The Football Manager 2010 is coming out soon and my laptop needs to be up to scratch.
    I know I need to upgrade it because Football Manager 2009 nearly killed it!
    At the moment I have 1.4ghz Intel Celeron M chip and 704mb of ram.
    What is the fastest chip I could put in? I've done a bit of research and found I can only have 2gb of ram
    The laptop is in perfect working order so I don't want to buy a new one just for the sake of it and its served me well over the last 4 years - I've dropped it enough times! Just need to speed it up a bit!

    Hmm... Do you really want to upgrade the pretty old Satellite Pro L20? I mean new notebooks are not so expensive anymore and I doubt that you will get a strong performance boost with new CPU.
    Anyway, in your notebook is only the preinstalled CPU pretested and nobody is able to say what other CPUs will run. But you should look on the specifications for other Satellite Pro L20 notebooks. If another L20 is equipped with faster CPU, it should also work in yours. You can try it but in worst case it will not work.
    Good luck!

  • What is the fastest way of getting data?

    With a scanning electron microscope, I need to scan a 512*512 pixel area with a pixel repetition of 15000 (two channels), meaning averaging over 15000 measurements. Simultaneously I have to adjust the voltage output for every pixel.
    I am using a 6111E Multifunction I/O board in a 800MHz P3. The whole task has do be done as fast as possible (not more than 20 minutes altogether).
    What is the fastest way to get this huge amount of data with averaging and output in between? (E.g. do I use buffered read with hardware triggering or is there a faster way?)

    Using the NI-DAQ API (not LabView) will give you a significant amount of more control over what happens and when to the data stream; which translates to a more efficient program. But you need to program in C/C++ or Delphi then. The Measurement Studio provides ActiveX controls that are like the LabView ones for C&C++ (they�re slow like the LabView ones though � not a lot you can do about the Windows GDI).
    What are you trying to sample 15000 times? The 512*512 pixel field?
    That�s almost 15Gigs of data! And it means you need to process data at 12.8MB/s to finish it in 20 minutes. I hope you know C, x86 assembly and MMX.
    I would setup a huge circular buffer (NI-DAQ calls them �double buffers�), about 30 seconds worth or so, to use with SCAN_Start. Then I would proces
    s the actual buffer the card is DMA�ing the data into with a high priority thread. Progressively sum the scan values from the 16bit buffer (the samples are only 12 bit, but the buffer should still be 16bits wide) into a secondary buffer of DWORDs the size of the screen (512*512), and you�ll need two of those, one for each channel. Once the 15000 scans are complete, convert each entry into a float divide by 15000.0f, and store it in a third buffer of floats.
    If you wish to contract this out, send me an email at [email protected]

  • What is the different between payment methods Wire and EFT

    Hi All
    can anybody tell me What is the different between payment methods Wire and EFT ?
    Regards ;

    WIRE:
    Wire is transfer of amount due directly to the supplier's bank it is an electronic transfer of funds
    This mode of payment is used for international suppliers.
    It can be paid in foreign currency or USD.
    Wire payments are same day payments.
    EFT:
    EFT ensures funds transfer from one bank account to another using electronic links.
    Can be used to make payments into domestic banks (within US) in USD only.
    It is faster than check payments.
    Hope this helps.

  • What are the drawbacks of creating execute queues

    Hi thread Gurus
    What are the drawbacks of using execute queues. I understand that if queues are not used they stay idle but on solaris the SunOS scheduler will only give active
    threads CPU time. what ar the other resources being wasted in the process.
    I will appreciate if you can farward me to some documentation on this apart from performance docs on BEA site.
    Regards
    Parminder

    Hi Parminder,
    BEA docs cover tweaking exec queues pretty extensively.
    Could you provide more details on what kind of information
    you are looking for or which concerns do you have?
    Regards,
    Slava imeshev
    "Parminder" <[email protected]> wrote in message
    news:3ef86b40$[email protected]..
    Hi thread Gurus
    What are the drawbacks of using execute queues. I understand that ifqueues are not used they stay idle but on solaris the SunOS scheduler will
    only give active
    threads CPU time. what ar the other resources being wasted in the process.
    I will appreciate if you can farward me to some documentation on thisapart from performance docs on BEA site.
    Regards
    Parminder

  • There are over 4000 duplicates in my iTunes. What is the fastest way to delete them?

    There are over 4000 duplicates in my iTunes. What is the fastest way to delete them?

    Hello there, yandere69keita.
    The following Knowledge Base clarifies your concern about your My Photo Stream counting towards your iCloud storage:
    iCloud: My Photo Stream FAQ
    http://support.apple.com/kb/ht4486
    Does My Photo Stream use my iCloud storage?
    No. Photos uploaded to My Photo Stream do not count against your iCloud storage.
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Sq01 what is the fastest way,

    hi all,
    what is the fastest way to detect coding that update to eban  from sq01?
    as i am facing problem with more than 100,000 PRs updated mysteriously (customer tab data ) without any history changes .
    i suspected it might be from query and i need to find the root cause of problem immediately
    pls advice

    Hi Ester,
    Haven't got clearly what you written.
    You mean to say, there is modifications done to query for updation?
    if it is a standard code then I don't think it is used for modification.
    Regards,
    Atish

  • What is the FASTEST Internet Browser for OSX? (2014 Edition)

    What is the FASTEST Internet Browser for OSX? (2014 Edition)
    I'm a tech junkie, I love everything about technology.. especially FAST and EFFICIENT technology..
    I am currently using Google Chrome, and have nothing bad so say about it.. I like that I can "sign in" to Google Chrome pretty much anywhere (including my iPhone 5s), and instantly have access to all of my Bookmarks and Bookmark folders..
    I have seen a bunch of benchmark tests testing a bunch of available internet browsers on OSX.. however, the results seem a bit inconclusive and varying, and some that even support the notion that Safari is now FASTER than Google Chrome.. I'm not sure whether or not to believe it, and I don't really have the time/energy to conduct a series of tests on my own..
    What do you guys think? Is Google Chrome still considered the "fastest" when it comes to browsing/downloading?

    Has anyone used or have any opinions about Lightning?  I found some positive reviews around, and granted they all mention it's unrefined, they all seem to think it is the fastest.  Great as that may be, before I fork out the $2 I would like to get some more info regarding privacy and security.
    https://itunes.apple.com/us/app/lightning-web-browser/id412736557?mt=12
    A review
    http://mac360.com/2014/04/lightning-strikes-is-this-the-fastest-mac-web-browser- money-can-buy/

  • What's the fastest way to share files live between 2 Macs in the same room?

    Please can I have some advice on this scenario?
    I'll need to share HD video footage between 2 new Mac Pros in the same room. 1 Mac will be used to upload the footage and the other to edit it using FCP. The footage can be stored either on hard drives in the edit machine or on desktop hard drives connected to the edit machine (or if there is a better option I'm open to advice).
    What is the fastest way of sharing the files and what is the simplest way?
    Any suggestions would be greatly appreciated.
    Thanks in advance

    What is the fastest way of sharing the files and what is the simplest way?
    Fastest way? a fiber channel SAN connecting the two machines to a common fiber-channel based storage array. Can't beat it for performance, but it comes at a cost (think $20K as a starting point, depending on the amount of storage you need).
    Simplest way? Some external media (thumb drive, external hard drive, etc.) that you shuffle between the two machines
    Intermediate: a NAS-based storage box on your network, although be aware that real-time editing of HD video can overwhelm many low-end NAS boxes.

  • What is the fastest OP system for a Macbook Pro Retina 2.6?

    What is the fastest OP system for a Macbook Pro Retina 2.6? I'm new to Mac so please excuse the weird question.

    Ok but that is a feature that I think is available to older Mac's that have an SSD so it is not totally restricted to Retina models or even the newest models of Mac's.
    With that you could say No Mac is what you paid for without ML installed. Which I disagree with.
    wjosten wrote:
    Shootist007 wrote:
    Not really sure about that.
    Well, I am. Power Nap is just one of the features you don't get on a Retina unless you do run Mountain Lion.

  • Buring a DVD now and then another one a week later. What is the fastest

    Buring a DVD now and then another one a week later. What is the fastest way to burn the second copy? I thought maybe burn to image but that doesn't seem to make a DVD that plays when you put it into a DVD player. Is "Save as video_ts folder" the best way? When I go to do a regular burn it wants to encode everything each time unless I do all my copies right away. There is zero help in iDVD's help.

    You can copy a disc image to a physical DVD with Apple's Disk Utility, but I prefer Toast.
    Re Video_TS folders: This folder is the guts of a DVD, but the option is more advanced than I am. Toast can handle these folders, and lets you add DVD-ROM content subsequently (but you can add any files to the DVD-ROM area of a DVD from within iDVD). Toast is also able to compress large Video_TS folders to better fit on a DVD (so that could be useful). The Help function in Toast was the source for this info.
    John

  • What is the use of finalized method ..even though

    we know that java has inbuild garbage collector. then what is the need of finalized method.
    can any one give me the answer please

    The original idea was that you could use finalize() to clean up class-variable resources. For example, you might be (shudder) holding on to a database connection in a given object. The idea would be that you could close the connection within finalize().
    However, and I am not totally sure on this, but there seems to be a few issues around finalize() getting called by the garbage collector. There are also a few posts I remember admonishing programmers not to call finalize() explicitly. So, for me at least, I do not use the method and ensure I clean up any resources I have references to manually.
    - Saish

Maybe you are looking for

  • Need your suggestions for developing a Forum Site using Adobe Flex

    Hi , I want to develop a small Forum Site where people can post questions and reply to questions . I want to develop the whole thing using Adobe Flex , Is there any plugin avialable for this . Means i mean to ask , if i go for normal J2EE there is a

  • Ipod nano is frozen and nothing I do unlocks it....Help

    This is the 1st day I used this brand new ipod. Do not know a thing about them, but I did download music and it was fine and then a message appeared after several songs: message3 Aug 25, 2006. Does anyone have any suggestions?

  • Alt keys?

    Does the iMac keyboard have the ability to be used to get Alt keys?

  • For Best Quality? HELP HELP HELP PLEASE =)

    Im wondering whats the best way to get best quality when i save on my g4 to get on a disc to put on my Windows Vista Laptop. (CD-R? DVD-R? or DVD+R?) i have adobe premeire pro cs3 and want to get best quality when taking from my mac to my laptop to e

  • HDV Capture Problems

    Hi everybody, Im having a problem similar to this one here for FCP, http://discussions.apple.com/thread.jspa?threadID=1955982&start=0&tstart=0 Basically when I import my HD footage from my Cannon HV30 to my scratch disk (Lacie 1TB Connected Via FireW