Is it possible to wait on a queue and on a notifier at the same time?

Hi!
I am trying to implement an event-driven producer/consumer pattern with queues. The problem is that I have some value change events (e.g. coming from a slider) that I do not want to queue up; I want only the latest value change event to be processed by the consumer loop. This is because the consumer may spend longer time in executing (sometimes multiple seconds) and I want to prevent all intermediate slider events to be queued up in the meantime because I will finally write them to hardware. Therefore, a notifier would be better to use here than a queue. My question is if it is possible to make the same consumer loop wait on the queue as well as on the notifier at the same time? I will be wiring the VISA session and some other data through the consumer, so it want to avoid an extra loop that would wait on the notifier only. Or is there any other possible workaround?
Thanks in advance.
Regards,
Anguel
Solved!
Go to Solution.

AStankov wrote:
crossrulz, many thanks for the code example and this is probably exactly what Mark suggested. Unfortunately, I do not really understand the logic behind it, i.e. why wait on the queue and then on the notifier?
It isn't really waiting on the notifier.  The wait is set to 0.  So if there is no new data in the notifier, instant timeout and skip the DAQ stuff.
The idea here is to send the set value (from the slider) through the notifier and send the command through the queue.  When the consumer loop gets the command, it will read the notifier for the latest data point and go to work.  Now if the user changes a bunch of stuff while a "long" acquisistion is happening, the notifier will keep being overwritten; it will only keep the last commanded value.  The queue will get multiple commands, but only the last value will be worked on due to the notifier.  The remaining commands will check the notifier, see that there's no new data, and skip to the next command.
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines

Similar Messages

  • Possible to use both optical out AND regular line out at the same time?

    I currently have my computer speakers (logitech z560) hooked up to the mac pro via regular stereo jack in the back. I have an extra receiver that I would love to hook in to supply me with some needed sound for movie watching and what-not.. Is there a way to enable both line out - digital and line out at the same time?

    You can set DVD Player's "Audio output" to "Digital Out" in its "Disc Setup" preference, while other applications use Line Out.
    You could use a splitter on Line Out to feed your current speakers, and analog Line In on your receiver. When you want sound to both systems, set the receiver to Line In. When you want to watch DVDs, set it to Digital In. This will give you surround sound if the DVD has multichannel sound, and the receiver supports more than two channels.
    If you really want the same output on the Mac Pro Line Out, and Digital Out, you can use the "Auxiliary Device Output" effect in Audio Hijack Pro
    <http://www.rogueamoeba.com/audiohijackpro/>
    It will not support more than two-channel audio.

  • Is it possible to use both an ILB and an ELB (listening on the same port) in the same Azure cloud service?

    I'm building a test Lync deployment on Azure; yes, I know this is not supported, hence "test".
    Lync Front-End servers expose two set of web services, one for internal users and one for external ones; they listen on different ports (443 and 4443) on the same servers; when external services are published, you need a reverse proxy or a port forwarding
    in order to map port 443 of a public IP address to port 4443 of the Front-End server(s). When you have multiple Front-End servers in a pool, you also need to load-balance them.
    So, a typical Lync deployment looks like this:
           Internal users
                     |
                   443
                      |
              Internal LB
            192.168.0.20
            443         443
              |               |
       Lync FE 1     Lync FE 2
    192.168.0.21 192.168.0.22
              |               |
          4443        4443
              External LB
           Public IP Address
                     |
                  443
                     |
           External Users
    This should be easily replicated in Azure, as it supports both external load balancing and internal load balancing. They are even supported together in the same cloud service, so this configuration should be easy. However, it looks like "should"
    is the keyword here.
    After creating the external load balanced endpoint (which listens on external port 443 and forwards to port 4443 on the servers), I'm trying to create an internal load balancer and add internal endpoints to is; however, while the ILB can be created successfully,
    adding an internal endpoint listening on port 443 and forwarding to port 443 on the servers fails miserably, with an error stating that port 443 is already in use by another endpoint:
    Update-AzureVM : BadRequest : Port 443 is already in use by one of the endpoints in this deployment. Ensure that the port numbers are unique across endpoints within a deployment.
    For reference, my commands are:
    Add-AzureInternalLoadBalancer -InternalLoadBalancerName "LyncILB" -ServiceName "LyncFrontEnd" -SubnetName "LabSubnet" -StaticVNetIPAddress 192.168.0.20
    (This completes successfully)
    Get-AzureVM LYNCFE1 | Add-AzureEndpoint -Name "Https-Int" -Protocol "tcp" -LocalPort 443 -PublicPort 443 -LBSetName "HttpsIntLB" -DefaultProbe -InternalLoadBalancerName "LyncILB"
    (This fails)
    The existing external endpoint is configured as such:
    Get-AzureVM LYNCFE1 | get-azureendpoint
    LBSetName : HttpsExtLB
    LocalPort : 4443
    Name : HTTPS-Ext
    Port : 443
    Protocol : tcp
    Vip :
    ProbePath :
    ProbePort : 4443
    ProbeProtocol : tcp
    ProbeIntervalInSeconds : 15
    ProbeTimeoutInSeconds : 31
    EnableDirectServerReturn : False
    Acl : {}
    InternalLoadBalancerName :
    IdleTimeoutInMinutes :
    LoadBalancerDistribution :
    The error doesn't even make a lot of sense; the external load balancer listens on a public IP address, while the internal load balancer listens on a private IP address in the internal network; there
    shouldn't be any conflict here... however it looks like there is one instead.
    Why doesn't this work? Am I doing something wrong, or is Azure networking just being silly as usual again?

    Hello Massimo Pascucci,
    The issue that you are facing when creating an endpoint with internal loadbalancer is the limitation of not allowing same ports to be listening under a single cloud service. This reason for this is that there is a limitation of only one private IP (Also
    known as the Internal load balanced IP) per cloud service.
    There is also a limitation on the Internal load balancer more than one port to be published per load balancer:
    You can leave your feedback by following the link below:
    https://social.msdn.microsoft.com/Forums/en-US/1805c5a0-3906-4cd6-8561-9802d77e0ae5/is-it-possible-to-use-both-an-ilb-and-an-elb-listening-on-the-same-port-in-the-same-azure-cloud?forum=WAVirtualMachinesVirtualNetwork
    Refer to this article for more information on Internal load balancer:
    http://azure.microsoft.com/blog/2014/05/20/internal-load-balancing/
    Thanks,
    Syed Irfan Hussain

  • Is it possible to burn 1 dvd project onto 2 dvd's at the same time?

    Is it possible to burn 1 idvd project onto 2 different discs at the same time. i have an external burner so that wont be a problem i am just wondering if it is possible to burn both at the same time

    You can't do it out of iDVD.
    If you create a disk image file (.img) out of iDVD you MIGHT be able to do so using Roxio's Toast and the .img file.
    http://forums.support.roxio.com/topic/70423-burn-to-multiple-drives-from-one-ima ge/page__p__355967__hl__multiple+drives__fromsearch__1#entry355967

  • Is it possible to have an attachment within a pdf doc print at the same time the main doc prints?

    Okay, so this may be kind of a weird question.  We have some users who are wanting to add a page to an already existing xml document and correct me if I'm wrong, but I've read that it's not possible to add/delete pages from a pdf that's in xml format.  Since that is not possible, I have added the page to the xml document as an attachment.  Now what I am wanting to know is if it is possible to have the attachment print out at the same time as the main document.  We are using the latest version of Adobe Reader and I have access to Adobe Acrobat Standard 9 & 10 and then I have access to Adobe Acrobat Pro 7.  I've been unable to find anyting via google or by searching this forum so hopefully I'll draw out some kind of smart cookies and we'll get this figured out.  I appreciate any and all input!
    Thanks,

    I know of no way to do this with Reader or XML.

  • Is it possible to convert several pdf files (into Excel or Word) at the same time ?

    I'd like to convert several pdf files (up to 500) into Excel at the same time. Is it possible ? How many files can Export PDF handle at the same time ?
    Thanks a lot for your answers,
    Sylvain

    Hi, Sylvain.
    This is a great idea! Currently, ExportPDF only can export 1 file at a time. (Acrobat can do a batch export using it's Action Wizard feature.)
    I added your idea to our idea list: http://forums.adobe.com/ideas/1499. If you'd like to see us add this feature, please go vote or add comment to this Idea on the idea list.
    Dave

  • Is it possible to airplay my extended desktop to multiple apple tv at the same time

    Hi
    I am looking to do video distribution in the venue I work in thrue multiple apple tv. The Idea is to use AirPlay and to send my extended desktop to about a dozen apple tv at the same time. is it possible to do it ???

    Winston is correct you may want to consider a multiplexer its what places like bars restaruants usse when the wat several tvs to use the same imput. is cheaper then several apple tvs hers one at $132.74 i have never used it but searced google and found it would give you up to 8 tvs of one HDMI signal.
    http://www.cablewholesale.com/products/hdmi-products/hdmi-switch/product-41h1-08 1hd.php?utm_source=GoogleShopping&utm_medium=organic&zmam=54972865&zmas=1&zmac=1 &zmap=41H1-081HD

  • Is it possible to load Final Cut X and Final Cut 7 on the same macbook pro?

    I already have Final Cut X on my MacBook Pro and I tried to load Final Cut 7 on there and after it said install complete I checked and it was not in my applications but the peripheral applications were. Is it possible to load them both on the same mac?

    You must install Final Cut Studio first, run all updates and then you can install FCP X.
    Go to digitalrebellion.com, get a free copy of FCS Remover and use it to uninstall FCP X.
    You can then install FCS and download FCP X again -the AppStore knows that you already paid for it.
    FCS will be moved to its own sub-folder in Applications.

  • Is it possible to create a script to produce a high res and low res pdf and jpeg from Indesign at the same time

    Hi, I'm just wondering if there is a way to automate a long process I have to do to create assets for my job.
    I have a single page InDesign 6 file which I have to output three ways:
    A low res pdf without bleed or trims
    A high res pdf with bleed and trims
    A low res jpeg downsized to 2% of original size.
    If anyone knows if this is possible I'd love to hear from you.
    Thanks in advance

    Automation requires creating your own IDML script for output. Scroll down on this page to the section on Scripting resources. The text is a bit confusing. It says InDesign CS5 Scripting resources, but then the paragraph for that section says the PDF files are for CS6. I haven't read through these, I just found them by searching for "indesign automation". It does say in part that is can be used for preparing files for printing, so once you figure it out, it should be a single click option to do all three steps.
    You can do them now with the menus you have, assuming you also have Acrobat Pro installed. With any document open, choose File > Adobe PDF Presets, and choose either from the prebuilt defaults, or create your own in the Distiller. However, I don't see a way in the Distiller settings to choose whether or not to include bleed and marks, so I'm not really sure how you'd have them on for one and not the other. As far as JPEG output, that can be chosen under Export. You get a choice to set a resolution and JPEG quality level, but not a size, so the output will be the dimensions of the document.

  • Is it possible to have more than one event/project in Imovie at the same time?

    Let me see if I can shorten this. I am working on a project for a review. It's going to take quite awhile and I'm half way through it. However, I need to work on another project, one thats short and I can dish out fairly quickly. My problem is that I cannot start it without discarding my current project. Which I cannot do because I will lose a weeks worth of data. And I cannot save it because it will combine all the clips and I would have to re-split them (half a days progress).
    So in short, is there a way to save my project as-is? Or possible create a new event and start a new project while maintaining my current work? Thank you for your help!

    Version 10.0.3 is the latest version of iMovie. iMove '11 (as in 2011) is version 9.
    iMovie saves your Projects automatically. So you can just choose to create a new Project. Your existing Projects will remain available for you to go back to whenever you like.
    You can have as many Projects as you like. You don't need ot finish one before you begin another.
    Post back if you have specific questions.
    Matt

  • Is it possible to receive iMessages for two appleids on one mac at the same time?

    I (like many of you) have two AppleID accounts with different email addresses (come on Apple let us merge accounts).
    On my iPad and iPhone, I can receive iMessage traffic for both accounts. On OS X Yosemite I can only get one or the other.
    Is there any way to set up OS X to get both inbound account iMessages?

    Sorry, no. Photo Stream is independent of the Camera Roll. You have to do them separately.
    Cheers,
    GB

  • Is it possible to enqueue multiple elements in a queue at the same time

    I want to know that is it possible to add mutiple elements in a queue at the same time, i am able to do one element at a time if i want iw ill be using for loop, but is it possible without for loop????
    nilesh

    You can't, but if you may redefine the  queue datatype as an array.
    Paolo
    LV 7.0, 7.1, 8.0.1, 2011

  • Is it possible to output multiple clips from a multitrack session, at the same time?

    I'm using Audition CC 2014.2
    on Windows 7 Pro x64
    I am trying to figure out how to output several clips from a multitrack session, at the same time.
    A session like this:
    Is it possible to output 5 files right now?
    I can select each one (or even multiple) and use File > Export > Multitrack Mixdown > Selected Clips to do one at a time only.
    I'm hoping for a way to give each clip (or group of clips) a predefined filename, by perhaps using markers or something like that, which would then allow me to faster "automate" the exporting of each section into a different sound file.
    This ability would be really helpful when using a single multitrack session to generate multiple sounds and a change to globally applied effects is made and all sounds now need to be updated.
    Any ideas?

    They are, yes, but I'm also working with multitrack sessions using clips made from various different sound files.
    Ahh ok, use markers?
    So, this sort of thing isn't possible in multitrack mode then?
    If not, it sounds I'll have to "mix down" my multitrack session into a single file and set up the markers in Waveform Edit view.
    That's an extra step I'd have to do, and after editing the multitrack session, surely some markers . . . oh wait, no . . . every time I output the new mix down file from the multitrack I'd need to redo all the markers. Drat . . .
    Honestly, I am very new to Audition, but I'm about to plow into it, big-time, and I'm hoping for a nice non-destructive and fast workflow that'll enable me to output sets of sounds from the same multitrack session.
    But, it seems like this functionality is currently missing.

  • Is it possible to realize two different processes in the same time with TDMS?

    Hello all,
    we have one TDMS but a lot of workstreams. Is it possible that 2 different workstreams in the same time realize anonymization in TDMS?
    Thanks in advance!!!
    Ilkin Mammadov

    Hello Anita,
    I am sorry.I mean we have a lot of projects (for example Procurement, Finance, Logistics, etc) and each of them wants to anonymize. But it is existing just one TDMS. Can these projects start with anonymization in the same time or they have to wait till one of projects finished anonymization?
    Thanks in advance!
    Best regards,
    Ilkin

  • Hi,  If I have 1 license for creative cloud, will it possible to install in 2 computers (1 laptop and 1 desktop)?  When I am in the office I can use desktop and at home I can use laptop? At the same time I will be using only one devise. Will that be possi

    Hi,  If I have 1 license for creative cloud, will it possible to install in 2 computers (1 laptop and 1 desktop)?  When I am in the office I can use desktop and at home I can use laptop? At the same time I will be using only one devise. Will that be possible?  Thanks

    Yes. Yes. Yes.
    Mylenium

Maybe you are looking for

  • Over Partition by in OWB 9i

    Hi, I am using OWB V9i. I need to implement an sql statement in a mapping.The statement is CASE WHEN (tr_dt=lead(tr_dt) OVER(PARTITION BY ID ORDER BY ID,tr_dt)) THEN lead(ef_dt) OVER(PARTITION BY ID ORDER BY ID,tr_dt) ELSE tr_dt END I am not able to

  • Messages transfer failure

    Hi, I have the latest PCSuite software version (6.82.22.0) installed on a PC with windows XP OS. It is not possible to transfer the messages (long messages, more than 160 characters) from my nokia 6021 (but the problem occurred even with a nokia 6070

  • I keep getting the warning the dmg files aren't recognized

    Is anyone else having issues with .dmg not being recognized? I am currently trying to open an updated xcode .dmg and it is not working.

  • CS 2 - Multilevel Numbered Lists

    Hi, I am running cs 2, trying to do an annual report and need to add a multi level numbered list i.e. 1.1 1.2 1.3 for the financial notes. cs 3 has this facility built into bullets and numbering thru paragraph styles, is there a way to achieve this i

  • Access restrictions - Any documentation or suggestions?

    I want set up fairly simple internet access rules - but it's just not working. I cant find any documentation beyond the very basics in the manual. Can someone help me with the logic behind defining overlapping Access Restriction rules? I'm assuming t