Does a CQC really need a separate thread/event queue per instance?

Does a ContinousQueryCache really need a separate thread/event queue per instance?
Is it possible to get multiple cqc's to share a single event queue?

Test case to reproduce shown below, i.e. new thread per CQC.
Sample code:
=====================================
NamedCache dummyCache = CacheFactory.getCache("A");
dummyCache.put("hello", "B");
dummyCache.put("world", "C");
ContinuousQueryCache cqcA = new ContinuousQueryCache(dummyCache, new EqualsFilter("toString", "B"), new MultiplexingMapListener() {
@Override
protected void onMapEvent(MapEvent mapEvent) {
System.out.println(Thread.currentThread().getName());
ContinuousQueryCache cqcB = new ContinuousQueryCache(dummyCache, new EqualsFilter("toString", "C"), new MultiplexingMapListener() {
@Override
protected void onMapEvent(MapEvent mapEvent) {
System.out.println(Thread.currentThread().getName());
=================================
Output:
EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), B)}
EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), C)}
=================================
Thread dump:
Full thread dump Java HotSpot(TM) Client VM (11.2-b01 mixed mode, sharing):
"EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), C)}" daemon prio=6 tid=0x034d8800 nid=0x16b4 in Object.wait() [0x03b2f000..0x03b2fa94]
java.lang.Thread.State: WAITING (on object monitor)
     at java.lang.Object.wait(Native Method)
     - waiting on <0x22d80068> (a com.tangosol.util.TaskDaemon)
     at java.lang.Object.wait(Object.java:485)
     at com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
     - locked <0x22d80068> (a com.tangosol.util.TaskDaemon)
     at com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
     at com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:714)
     at java.lang.Thread.run(Thread.java:619)
"EventQueue:ContinuousQueryCache{Cache=A, Filter=EqualsFilter(.toString(), B)}" daemon prio=6 tid=0x034d7400 nid=0x1370 in Object.wait() [0x03adf000..0x03adfb14]
java.lang.Thread.State: WAITING (on object monitor)
     at java.lang.Object.wait(Native Method)
     - waiting on <0x22d80138> (a com.tangosol.util.TaskDaemon)
     at java.lang.Object.wait(Object.java:485)
     at com.tangosol.util.TaskDaemon.takeNextRipeTask(TaskDaemon.java:345)
     - locked <0x22d80138> (a com.tangosol.util.TaskDaemon)
     at com.tangosol.util.TaskDaemon.run(TaskDaemon.java:103)
     at com.tangosol.util.Daemon$DaemonWorker.run(Daemon.java:714)
     at java.lang.Thread.run(Thread.java:619)

Similar Messages

  • Does URLLoader load data in a separate thread?

    I understand the Flash and AS3 is single-threaded, at least at the user level.
    However, I would like to understand how asynchronous data loading is handled by the Flash player.
    For instance, if I run CPU-intensive code that runs beyond the normal frame (lets say it runs on ENTER_FRAME, and consumes 1/4 per call).  Does this leave any CPU cycles to load data from a URLLoader?
    If http loading is truly synchronous, right down to handling the TCP/IP stack, one would get horrible performance.
    In Windows programming, I can do http access asynchronously (in which case the Windows libraries are doing either input on a separate thread, or doing hardware-level interrupts to handle the data -- I provide an asynchronous callback that may be on its own thread).  Or, I can do synchronous download, in which case there will be hardware buffering, but my application is actively waiting for each buffer of data to be delivered by the hardware/OS combination.
    URLLoader is asynchronous, but what does that mean?  Does it mean that I can run the CPU and still download data?  Or, will my download speed slow to a crawl if my Flash application is under heavy CPU load?
    Understanding how this works will help me design my product better, which both uses a lot of CPU, and downloads a lot of data (to the bandwidth limit of the network, if possible).

    >>"no data handling can occur if the cpu is 100% occupied.  so, the download will slow/stop."
    Operating systems have pre-emptive multitasking, so if download were in another thread, it could still operate.
    My CPU has 4 cores.  So by 100% busy, I meant that I am getting close to maxing out the main thread of Flash, which only uses one core.
    >>data downloading being asynchronous means while data is downloading the cpu and your actionscript can do other things
    This is my question exactly.  Asynchronous can mean many things.  At the lowest layer, at least one "buffer" of data (who knows what size) has to be downloaded in a separate thread, or by hardware, or by the browser, etc.  Flash could have a background thread internally that grabs data from this buffer, and does something with it.  Or, Flash could rely on polling this buffer on the main thread in-between frames.  The last method would be bad, as it would rely on the user not using the complete CPU usage per frame.
    The real truth may be a combination of these two -- it may download in a background thread, but only up to some limit, at which point the Flash main thread has do internally grab it?
    >>but it is possible to have other actionscript tasks or flash animations interfere with downloading.
    My question is, how much care and feeding does the download require?  Does it work quite well by itself, and is rarely affected by AS3 CPU use, or is there a requirement to not use up all of the CPU per-frame in order for the download to proceed?  In my case, I may stretch my frames out to 1/4 second, as I do intensive CPU work.  Would this slow or stop my downloads?
    Thanks for the helpful reply -- I would love a bit more detail though.
    Also, I'm more likely to be using URLStream in my actual implementation.

  • Does iPhone 6 really need a screen protector?

    Does the iPhone 6 really need a screen protector if the phone is in a case?

    I put one on my iPad 2, largely cause it's an expensive toy and I want to keep it in good shape. I like knowing that if my niece plays 'mad birds' and gets grubby little fingerprints on it I am simply cleaning off a sheet of plastic, not the screen. I consider it an investment against the potential resell value whenever i replace it.
    Like the others have said, personal choice.
    I'd think if your device never leaves the living room table and is only used by adults in a controlled surrounding, then you probably have no need. But if you're carrying it around, using it anywhere, potentially sharing it with others then it may be a good idea.

  • Does my Battery Really Need Replacing?

    I have a MacBook 13" (early 2008) that I bought sometime in the middle of 2008 and so is about four years old.
    It works perfectly well.  The battery still only takes a couple of hours to charge and I'm still getting four to five hours of life from it.  I use it on battery power frequently and try not to leave it on the mains too long (after charging).  I also calibrate it about once a month.
    However despite all that, I'm told via my battery icon that my battery needs to be replaced soon.  The only strange behaviour is that it doesn't always know it's fully charged.  If I charge from near empty or empty (especially during calibration), it reaches 99% charge in the usual time, but then stays there permanently (with orange charge light).  But if I take out the power and put it straight back in again, it instantly registers as 100% fully charged and I get a green light.  Other than this, I haven't noticed any other unusual behaviour, and as I stated before I'm still getting excellent battery life out of it.
    So my question is simply, do I really need to worry?
    Thanks.

    Check out this article on preserving your battery for as long as possible:
    http://moukisfashion.blogspot.com/2012/10/lifestyle-how-to-preserve-your-macbook .html
    I think I saw somewhere that you should change your battery every 2 to 4 years.

  • Does iPhone 4S really need a case?

    So I just bought an iPhone 4S, and I'm wondering if it really needs a case, or a screen protector, or both. It just looks so good without it.

    No.  A case will provide protection. How much depends on the case.  A screen protector is supposed to provide protection against scratches.  There is a debate on if this is necessary.  Personnally I use a holster case and a clear plastic case that surrounds the back and sides.  I also use a screen protector because it seems to reduce fingerprint smudges on the screen. 

  • Does a DSL really need a ISP?

    I have a Login/pass for Qwest and for MSN. Do I need MSN to access the net?
    I've only logged in once on MSN during setup. My modem uses the qwest login to connect not MSN's. I would like to drop MSN to save a few $$.

    Does Qwest provide an e-mail account? That's the only thing I can think of that
    MSN is providing that you might not get fro myour DSL provider. If you're happy with Yahoo mail or Gmail, then all the better.
    Unless you're really hooked on MSN "content", your DSL connection should
    suffice.
    Editorial comment: note that AOL is trying to save their business by adding in all sorts of virus protection for PC users to justify their subscription fee - yet another reason to be happy with your Mac...

  • What does a MAC really need to do justice to FCE and FCEHD?

    I need to purchase a new laptop. I want to use it to prepare 45 min documentaries. The original video will have audio filmed with it. I will want to add more narration, music, more photos, ie. the works. I have been using iPhoto and find that video containing audio and background noise, plus added narration, photos, and background music limits me to 20-30 min DVDs before stuttering occurs. What hardware do I need to do a professional job?
    G4 Dual 1 GHz BUS 133 MHz using an external hard drive for iMovie   Mac OS X (10.4.8)   all software updates
    G4 Dual   Mac OS X (10.3.9)   all software updates

    Hi(Bonjour)!
    A laptop is not for professionnal video editing in a regular basis ( at least in your home editing room).
    If you need absolutely the portability, that's Okay, but keep in mind that Hard Drives of laptop are slower than one in desktop machine. An external Hard Drive is recommended.
    A desktop machine is less fragile, has more connectors on it and is generally faster that the "laptop" little brother (in a head to head comparaison at the same introducing date, the laptop are one generation behind ).
    A desktop machine can be easily upgraded and the parts are less expensive.
    A good mic is a must to catch good voice overs.
    Michel Boissonneault

  • Joining separate threads in different application instances

    Is there any way to have a thread running on a machine that will pick up any new request?
    If application A is running all day on a server, can I start another instance via command line
    that will join that 1st thread/queue, to use it resources, like a connection pool?
    Is that just a servlet with a wider scope?

    What you are talking about really is starting an application in JVM A, and then running a small auxiliary command in JVM B that communicates with A and tells it to start another thread to perform some task. The communications part of this is done with sockets, RMI, etc, and the threading part is done with a Thread, or the services in java.util.concurrent.

  • Is the main program seen as a separate thread ?

    I wanted to stop a GUI based program opening too fast because the splash screen wasn't seen for long enough.
    So I tried to use the Thread and Runnable classes within the GUI constructor.
    By trying different things, I got it to do as I wanted : a delay of 10 seconds before showing the program's GUI.
    But I don't understand why main is not seen as a separate thread and thus continue to make itself visible no matter what the delayThread status may be.
    // Constructor:
    public Hotel (int numberIn)
             // Create the time delay thread so that users may enjoy the splash !
             delayThread = new Thread(this);
             delayThread.run();
             // Initialise the number of rooms and the GuestList :        
            noOfRooms =  numberIn;
            guests  = new GuestList(noOfRooms);
            // Graphics settings:     
            setTitle("Hotel");     
            setLayout(new FlowLayout());
           // etc. etc.
           // etc. etc.
           setVisible(true);
        // A run method to delay the program opening:
        public void run()
             try
                  delayThread.sleep(10000);
             catch(InterruptedException ie)
                  ie.printStackTrace();
        }Now, maybe a better way to do this would be to move the setVisible statement from the constructor to the run method.
    Maybe there is an even better mechanism for producing a delay in a program's opening.
    But I'm still curious as to why the main thread was delayed by a delay in what is really an entirely separate thread.
    Any ideas ?
    Edited by: KonTiki on 16-Feb-2013 13:10
    Edited by: KonTiki on 16-Feb-2013 13:19
    Edited by: KonTiki on 16-Feb-2013 13:20
    Edited by: KonTiki on 16-Feb-2013 13:21
    Edited by: KonTiki on 17-Feb-2013 09:16

    Well, first of all calling a Thread object's run() method just runs the code in the same thread. It doesn't start a new thread -- that's what calling the start() method does.
    And the Thread.sleep() method is a static method, meaning "Make *this* thread sleep for X milliseconds". So calling it on another Thread object doesn't cause that thread to sleep, it causes the current thread to sleep.
    I suggest you should go through the concurrency tutorial from Oracle because you seem to be programming by guesswork here.

  • What DB roles are REALLY needed by the applications?

    During our upgrade, the security / database guys at my office want me to lockdown the db accounts for portal, publisher, collab, anaytics, etc (also services, notification, security...all the alui related databases). They say that dbo is too privileged and I need to figure out just what the applications need and give them access.
    My question is...what does each account REALLY need? Some accounts create tables (analytics). Is it sufficient for those accounts to just be given CREATE TABLE privileges? Can every other account just be given normal CRUD access?

    fair enough.
    Ali, where did you find the SQL scripts for Collab? Is it someplace I can view easily?
    One comment would be that of course it would be fine for these accounts to have DBO during upgrades, etc, if that is the only time when these 'creating views, indexes, and SP's' are used...

  • How do I make a JSlider update my canvas with a separate thread?

    I want to have the option to update my canvas slowly (Thread.sleep commands), so I need a separate thread to do this.
    My problem is: I want the slider to make the canvas update continuously as the user moves the slider, but right now, I'm ending up with countless new threads being created...
    How do I:
    1) keep it at only one separate thread that controls redrawing, and
    2) make it stop when the user moves the slider farther
    Also, if I call MyCanvas.repaint(), which is the canvas class in my program, but outside the RepaintThread,
    will this cause my main thead to sleep?

    To get better help sooner, post a SSCCE that clearly demonstrates your problem.
    Use code tags to post codes -- [code]CODE[/code] will display asCODEOr click the CODE button and paste your code between the {code} tags that appear.
    From your problem description, a solution may be to use javax.swing.Timer and SwingWorker.
    The Java Tutorials: [Worker Threads and SwingWorker|http://java.sun.com/docs/books/tutorial/uiswing/concurrency/worker.html]
    db

  • HT1899 I have Lion 10.7. To install Windows 7 can I just use MozyHome 6.2.1.515, or do I really need a CD or DVD disc? Do I have to purchase anything (licensed) Windows from Microsoft?

    Friday  18 May, 2012 6:35 PM (Atlantic Time)
    I have Lion 10.7. To install Windows 7 can I just use MozyHome 6.2.1.515, or do I really need a separate CD or DVD disc? Do I have to purchase anything (licensed) Windows from Microsoft?
    Thanks, anybody.
    Sincerely,
    Steven L.Hamilton, M.D.
    Halifax    CANADA

    Microsoft is not in the business of giving software away for free, they sell it instead.
    Buy a copy of Windows 7 Home premium or Professional, then install it using the method of your choice.

  • Does AppleTV really need an internet connection

    Just a quick question - does AppleTV really need an internet connection. I am really struggling with the same syncing problems that many people describe on these forums. AppleTV will show on my devices now and again, it tries to authorise with iTunes, syncs for a while and as long as it is connected and showing in the device list I can view any of my movies, TV programs or music on my AppleTV.
    But for some unknown reason the Apple TV fails to sync properly, disappears from the devices list and then tells me that there is no content stored on my AppleTV. Very frustrating as you can imagine. Everything checks out - I have good signal strength, can browse the iTunes store and Youtube but the syncing just isn't working.
    I have read about problems with the BT Home Hub that I am using for my wireless network and despite taking the recommend steps to open the relevant ports on the hub to allow my AppleTV and computers to talk to each other properly I encounter the same problems.
    As a solution I was thinking that I could buy a wireless router and create a network that is separate from the network that I have for the internet and try syncing through that. I don't really want to spend money on a new router unless it is likely to solve the problem.
    What do you think?

    Thanks for all the comments guys.
    Latest update: I decided to try it and have had some success. I acquired a basic Netgear wireless router and set it up in isolation from my BT Home Hub network. I used the basic settings wizard and let it do it's thing.
    The AppleTV does show in my devices list however it does disappear randomly every now and again. Syncing has worked although for some reason I can only sync one item at a time - leaving me to have to repeatedly hit sync on iTunes, which is irritating but much less than not being able to sync anything at all. I have since dedicated my old iBook to the new network to act as my media machine.
    Conclusion: I'm not sold on this as a solution but as I'm not bothered about accessing the internet through AppleTV it suits me for now. I just wish that I had not bothered with AppleTV and just got a MacMini. For all the hassle and the usability issues I would gladly have paid the extra £200 or whatever.
    When it works the AppleTV is great but when it doesn't I just want to throw it out of the window.

  • My ipad mini does not restart when i press and hold the home and power buttons for a minute or more. what do i do? i really need to access some information on it. please help.

    my ipad mini does not restart when i press and hold the home and power buttons for a minute or more. what do i do? i really need to access some information on it. please help.

    You need to connect to iTunes and restore.
    iOS: Not responding or does not turn on
    You may need to put the device into recovery mode, this is covered in the link on this page.
    Did you back up the device?

  • I really need someone to help me. I have been trying to figure out how to select a PDF document to convert to a Word doc. When I go to select a PDF file, all that shows up is the WORD docs. does not show ANY of my PDF files... Please help me figure out wh

    I really need someone to help me. I have been trying to figure out how to select a PDF document to convert to a Word doc. When I go to select a PDF file, all that shows up is the WORD docs. does not show ANY of my PDF files... Please help me figure out what is going on? We have it set on auto renewal so I know its not that we haven't renewed this subscription, because we pay automatically.

    Hi olivias,
    It sounds like there may be some confusion on your system about what application should be associated with PDF files. You can reset filename associations by following the steps in these articles (depending on your operating system):
    How to change the default application for a file type | Macworld
    http://windows.microsoft.com/en-us/windows/change-default-programs#1TC=windows-7
    Please let us know if you have additional questions.
    Best,
    Sara

Maybe you are looking for

  • Issue on Scheduling a report in OBIEE 11g

    Hi Everyone,         I have a report in OBIEE which i want to schedule this report like this,., Say i am in a month August and for this month my report has to schedule on monday for 1st week, monday and tuesday on 2nd week , monday and tuesday and we

  • Problem using iPod as encrypted disk for G4 Backup

    i have created an encrypted disk image on my iPod for backing up my G4 desktop folder. works like a charm. however, OSX limits the size of this disk image to 500MB when it is created using Disk Utility. that is unfortunate since my desktop folder is

  • Lumia 920 broken glass

    My white lumia 920 screen broke when it slipped from my breast pocket and crash landed on a hard surface, please what can i do cause am missing my phone so much already and it was is my meeting hub with my clients and want something done fast. bought

  • WLSE no disk space error

    I am trying to upgrade to 2.12 but get the error message "WLSE-2.12u-K9.zip.1: No space left on device". I have installed the CSCsc93623 which I thought addressed the problem. I believe it is referring to /tmp directory, I have plenty of space on /va

  • Bug in Netbeans Java compiler?

    I think Netbeans (or Java itself?) has a major flaw in its compiler design. Explain to me why the following code is not compilable. Specifically, why it should complain about line 8: cannot find symbol symbol : variable Selected When I clearly declar