A question about synchronized waiting (block mode) for CPI in BB

Hello

I have such a scenario.

Process a need to send a message to process B, in the send method, we need to wait until it receives the

notification of process B that B has processed the message.

All I know is that using ApplicationManager PostGlobalEvent() can send a message to B. But it is non-blocking mode.

For example, after PostGlobalEent(), A must wait an appropriate event. There may be an another globalevent in A listener to listen on

the notification.

Thus in A, we will wait indefinitely until the listener has defined a status which a no need to wait any longer.

I think that Infinity waiting consumes too much battery of BB.

Is there a better method to avoid this problem constantly wait?

In Windows Mobile, waitForSingleObject can easily deal with such a scenario. (blocking for the notification mode)

I don't know if there is a similar way in BB.

Any help?

Sorry, I misread your original message and began to talk about the broader and more complicated case.

You seem to want to send a message and it will hang until it is processed. You can do this as follows. You basically need a flag that can be set and queried in a thread-safe way, and it should also be possible to block until the indicator is defined without having an impact on the battery. The solution is simple. You need a flag (for example, a Boolean variable) and a monitor object. For example, you can put a Boolean field in the class of your message and use the message as a monitor instance. The beneficiary will be the message, treat it, acquire the monitor, set the flag and call notifyAll() on the monitor. The sender can thus post, acquire the monitor and loop until the flag is set, while citing wait() on the screen after each failure audit. This will have the effect of blocking the sender if the message has not yet been processed and that, until the message is processed. Waiting for a monitor is very cheap in what concerns the use of the battery, so don't worry about this.

You can extend the simultaneous construction above to have a flag + result/exception and you get something similar to java.util.concurrent.Future of J2SE, I was talking about in my previous posts.

P.S. If the processing of the message does not have a lot of time, I suggest that you consider the much simpler solution of using Application.invokeAndWait.

Tags: BlackBerry Developers

Similar Questions

  • Questions about migration on server 1 for win 7 PC temporarily

    Hello, I am charged with moving that customers 2 of our current of 2 to VMware host separate Windows 7 64-bit PCs TEMPORARILY so that I can install for free ESXi 5.1 as the new host (replacing the current host, which is a Standard operating system Windows Server 2003 on a server Dell Poweredge 2950 using VMware Server 1.0.10).  After the ESXi installation on the server, I intend to spend both clients as they exist now to the new ESXi host.

    I have a few questions about this project, and I hope I can pull your knowledge to help me.  My question is:

    (1) is this a feasible plan?

    (2) what methods would you recommend using?

    (3) should what tools I use?

    (4) can what version of VMware (free) I use on the 2 Windows 7 workstations to serve temporary guest?  A customer is our Standard Windows 2003 domain controller, and the 2nd is an email server and Linux-based web.  I intended to put each on a separate office.

    Any help you offer is greatly appreciated!

    Thank you

    D. Pichard

    You can use vmware player as a free virtual machine player.

    Use vmware converter to convert your servers.

    Is not recommneded for convert DCs however, what you might do, it is to build a new one. However, it is possible.

    the dell 2950: your host in the HCL as compatible uses 5.x

  • Question about the Maximum protection mode

    DB version: 11.2.0.4 3-node RAC (primary)
    Platform: Oracle Linux 6.4

    We are at the stage of the design of our installation of DR. This particular DB stores retail banking information. Each transaction is important.
    So, we thought to have standby mode Maximum protection for our side. We have a good network of low latency. We expect not to have as a standby DB.

    Question1.
    Lets say we have several sessions connected to the primary DB. In A meeting, for a particular Transaction if for any reason any primary DB gets acknowlegment on standby it again is applied while the session will hang. Right? What other sessions connected to the DB? They all have to wait until the transaction of A Session receives a confirmation of sleep, that take effect pending?

    Question2. Is there any circumstance that the primary DB stops due to lack of transportation again in Maximum protection mode?

    Hello;

    Data GuardConcepts and Administration11g version 2 (11.2) E10700-02

    1.4 DataGuard, Modes of Protection

    Exact quote form above the document:

    "To ensure that the loss of data can take place, the primary database stop,

    rather than continue the processing of transactions, if she can't write his stream of redo

    one or more synchronized pending database. »

    Best regards

    mseberg

  • Question about the flexible reference mode vs mode


    Hi, help me to make it clear what mode should I use for my ar test?

    If anyone can answer my questions, it would be useful.

    1. mode of reference

    1.1 reference mode has some standard scenario to make VDI workload. would you share the contents of these scenarios?

    1.2 how the reference mode simulates listening login for users of 400VDI?

    2. flexible mode

    2.1 How can I decide which mode should be used for my test, the remote control mode, the passive mode and local mode?

    in other words, what kind of test cases are recommended for each mode?

    I know remote mode is 1:1 for the client and the desktop computer, passive mode is 1: n and local mode is 0: n.

    2.2 how flexible mode to simulate the time to peak of connection for users of 400VDI?

    Thank you very much.

    Ayako

    1 Yes "remote" mode and specify 400 as the number of workstations. You need 400 clients to connect.

    2. you can see the workload mix on the ViewPlanner UI page. But for the event log, you can only select the 'word'.

    3. There will be a PDF report at the end with all the stats.

  • Questions about payment, cancellation, and planning for your review of VCA - VTC

    Fellow VCA (midshipman).

    I'm ready to go for my review of VCA - VTC, but I was interested in how you can pay for the exam and how much it costs. The last question, I think I found the answer to and $95, which is about €70? So, I registered for the exam with the assumption that I had to abandon in payment details before I confirmed. Unfortunately, I was already permanently registered after the first screen, I had to fill in and got an email sending me on the Pearson VIEW site. So I'm rather perplexed how me or maybe my employer can I pay for this review, if I can actually cancel it and if it is mandatory for me now to pass this review, now that I am registered of course for her.

    Kind regards

    Chris

    What you have said, I guess that the first site you visited was vmware.com and you completed the licensing process for the review.

    This operation generates an ID for you on VMware and PearsonVUE systems then this means that you can program review and pay via PearsonVUE.

    I don't think at this stage there is no obligation to actually go ahead and take the exam.

  • A few questions about the sketch in Photoshop for iPad

    Hello

    I think to buy an iPad to use Photoshop sketch, since its compatible later with Photoshop on my desktop, but I have some questions that I hope someone here will know

    (1) do we have layers? If so, there is a maximum number that we can add?
    (2) we have the maximum number of disguise? (Canvas size)
    (3) can use us the color picker?

    I was thinking about surface 3 pro, but good it will be very expensive, so I came to this alternative! My goal is to shoot my Tablet and then if I want to be able to finish on my computer, but I have the basic features of Photoshop on my iPad. Thank you very much for your answers.

    Tiago

    Hi Tiago!

    the current short answer

    (1) No, sketch has no layer. Draw which is a similar application has layers. The two send to photoshop

    (2) to outline the size of the canvas are the dimensions in pixels of the iPad (2048 x 1536) when you make a shipment to Photoshop

    (3) Yes it is possible

    my penny. Download the two: draw the sketch to Photoshop, Illustrator. In: Photoshop, combine, and brush. You will use all the

  • Question about Threads with WHILE and FOR

    Hi all

    I have a question on threads with a loop on this topic sentece.

    Have the following class:
    class test{
    
    bool foundThing;
    PararellSearch(string [] lista, string s2find){
    while(!foundThing)
    {
    for(int i=0;i<lista.length;i++){
    if(s2find==lista){
    foundThing = true;
    break;
    }
    }
    }
    }
    If I start 10 threads which are using the PararellSearch method to look into lista, each of them inits into a different point, and when some of them found the right word then set foundThing= true. It will stop WHILE and FOR loop in all the threads? 
    If not, how could I do it?
    
    Thanks a lot for your help.
    David.
    
    Edited by: user13553506 on 27-dic-2010 12:15
    
    Edited by: user13553506 on 27-dic-2010 15:54                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

    When you post the code, you'll want to post a [url http://sscce.org] NBS so that it is clear that what you try to do it. For example:

    1. in the validation of code, put {code} before and after him, then he will be readable.

    2. the convention in Java must start with a capital letter class names, so test, could not test.

    3. the convention in Java is to start with lowercase letters, so parallelSearch, not PWhateverMisspellingYouHaveThere method names.

    4. There is no such thing as bool. It is a Boolean.

    5. it is a String, not string.

    6. never use == to compare the States of objects (such as the content of the strings). Use equals().

    To answer your question: If you create Test 10 objects, then, given that foundThing is an instance variable, there will be 10 variables entirely independent foundThing. An adjustment will not affect the other. In this case, the easiest thing to do would be to foundThing static, so that there is only one copy which is shared by the Test class as a whole. This isn't the only way, or even the best way in all cases, but you have enough other problems to face, so for now to keep things simple.

    Finally, when you have a variable that is shared by multiple threads, you need to either make all the access to this variable synchronized on the same lock (reads and writes), or you need to declare the volatile variable.

  • Question about Windows XP CD home for Satellite A105

    I have an A105 Satellite and recently it started running very slowly. With most of my machines I would wipe and rebuild them (all my data is backed up) but I don't have a CD Windows XP Home (it didn't is come with the laptop such as Windows has been pre-loaded - I think that this is the norm?).

    Is there a way to create the CD of the laptop or can I apply for a Toshiba?

    Thank you

    Steve

    Hello Steve

    Laptop computers are generally preloaded with the settings and also delivered with recovery media. Maybe in your country you can get laptop cheaper without the recovery CD. I don't know about you.

    What you can do is contact the partner of service allowed in your country and ask if they can order one for you. I'm sure that it should be possible.

  • Question about the extension of RAM for Satellite A50-522

    Hello

    I have a Satellite A50-522, with a Pentium M 715 @1. 5 Ghz processor and Intel 855GME chipset. To expand its RAM I referred to the Spain/Toshiba support website and I bought the PA3313U-2M1G (1 GB SDRAM 166 MHz DDR333/PC2700) via amazon.com. It turns out that this RAM is for "Alviso chipsets" - which are those relating to the Intel Centrino processors with 9xx series express chipset. I called Toshiba/USA and they recommend the PA3313U-1M1G or its equivalent Kingston KTT3311 / 1 G (since it is impossible to find in the Mexico), instead of the one I already bought. They all seem exactly the same thing in their description, except for the note "alviso chipset.

    My questions are:
    (a) is the chipset of this computer, considered "alviso" type? and
    (b) if not, should I keep the RAM I bought already (PA3313U-2M1G for alviso chipset)?, can I have performance or compatibility problems? What are the risks of the use of this "alviso RAM' in a 'no-alviso chipset? I deeply appreciate your input.

    Thank you!

    Hello

    The RAM modules for especially for chipsets alviso are not known to me, but the Satellite A50-522 certainly supports the memory PC2700 PA3313U-1M1G bar.
    I guess the PA3313U-1M1G and PA3313U-2M1G are the same modules from memory.

    PA3313U-1M1G and PA3313U-2M1G memory module are supported the same specifications of 1 GB - SO DIMM 200 pin - DDR - 333 MHz PC2700

    I think you can use both modules without any problem.

  • Question about the Y510 AHCI drivers for install XP

    NiHao Lenovo Forum,

    I am a proud owner of your IdeaPad Y510. I just wanted to ask what the web page offers Lenovo the AHCI storage driver to activate the storage controller SATA on the motherboard for my laptop Lenovo IdeaPad Y510?

    I ask because Y510 as many users who install the XP will need to have these storage SATA controller drivers if they want to support higher speeds, hot plug and native command queuing (NCQ).

    I see that Lenovo provides the following AHCI drivers for ThinkPad found here:

    www-307.IBM.com/PC/support/site.WSS/MIGR-62909.html

    Also, it would be useful to let everyone know that Lenovo Y510 models come with what advice system that they have, with regard to the necessary SATA AHCI Controller driver for them.

    I see the ThinkPad models use Intel 82801GBM SATA AHCI Controller or Intel 82801HEM/HBM SATA AHCI Controller as indicated above from the URL.

    How can I check my Y510 to know what Intel SATA AHCI Controller is necessary here?

    Some clarification would be useful. Thanks in advance for any help and assistance here.

    Also another method here would not create an installation with the Intel Matrix Storage Manager drivers slipstreamed XP disc? And how does a person know which of the many Intel Matrix Storage Manager drivers should be slipstreamed to the pilot Y510 AHCI SATA Controller here?

    And how many different models of Lenovo Y510 uses different system boards? Think there are at least two, because some have been announced with a FSB 800 MHz right?

    Thanks for any help and support here in advance.

    Read the FAQ some might answer your questions.
    Also, I suggest that different motherboards are in different models, as I said there are even different colors - green and Brown motherboards there. Brown, I saw myself - those who are ASUS, green are unknown for me.
    Then, NCQ is not a feature of driver software. It is a material of HARD drive capacity to optimize movement traectory leaders to speed up the read/write process. So, no driver is required to activate. This work iven in the BACK.
    AHCI driver is inside driver chipset. Also, you can integrate it. Please, read the FAQ .
    HTH

  • Question about the MAXIMUM PERFORMANCE mode

    An excerpt of the ML note: 239100.1

    To participate in maximum performance the following requirements must be met:
    
        Redo Archival Process : LGWR or ARCH
        Network Transmission mode : ASYNC when using LGWR only 
        Disk Write Option : NOAFFIRM
        Standby Redo Logs : No, but recommended and required for Real-Time Apply   
    What is
    Standby Redo Logs : No
    What means? Cannot create a database without Online redo logs. Right?

    Standby Redo Logs are not the same as online newspapers. They are used only in the role of Eve (by RFS background process) to allow primary LGWR.
    You always want to create them regardless of the level of protection. They are (in theory) an option with Max Performance.

    Kind regards
    Uwe Hesse

    http://uhesse.WordPress.com

  • A general question about the stylesheet XSL - FO for BI Publisher

    Hello
    Of BI Publisher MS Word Add-in, there is a menu item that allows users to export my. Model RTF as an XSL - FO stylesheet. This provide great flexibility to users so that they can implement the most comprehensive features/features, which are not covered by keys/menus of Word Add-in, on their report. Now my question, how can reuse us this XSL - FO file (.) XML) when we finished editing on this subject? I tried to use the web client BEEP to download as a template of report TONE repository file, but it doesn't seem to work. Could someone give me an idea of this? There must be a way to deploy the XSL - FO stylesheet for model data BEEP otherwise, the item of menu "export" in word add-in becomes meaningless.
    Thank you very much.

    Just download the files you said.

    and click the new button at the top, it will create a new model with the name "new model".
    You have to assign one of the template you downloaded for this report. in this, there is an option as 'TYPE '.

    http://download.Oracle.com/docs/CD/E10415_01/doc/bi.1013/e10416/pptoutput.htm

  • Re: Question about the CD/DVD player for Portege M400

    I have a Portege M100 - and the CD-ROM drive does not work.

    Whenever I put a disc in I can just hear the motor turn the disc, but the computer is not picking up the drive. Device Manager picks up flawless.

    It doesn't seem to be any firmware for this sorting (or am I wrong).

    I've seen a DVD player for a M400 on ebay and I was wondering if that would take on my M100.

    Before buying it, I was wondering if anyone knew if it would be compatible. It seems to be OK size wise, but I was wondering if my Portege M100 XP would be able to use it.

    The description for the drive I want to put in the M100 is below:

    Thank you very much for your time. :)

    Description

    DVD +/-RW drive for laptop Toshiba Ultra Slim Bay Portege M400, S100 & Tecra S3

    Compatible models:
    Portege M400, Portege M405, Portege S100-S113, Portege S100-S1132, Portege S100-S213, Portege S105-S1133, Tecra S3,

    The Toshiba Ultra Slim SelectBay DVD SuperMulti Drive is a DVD burner that combines all the functions of a DVD player, DVD recorder, CD burner, and CD player in an ultra slim and ultra light. It gives instant access to CDs and DVDs and fits perfectly into your slot to drive Ultra Slim SelectBay of your Toshiba Portege M400, computer laptop M405, S100 or Tecra S3. It is the ultimate portable storage for mobile users.

    Drive ultra slim and ultra light, fits perfectly in your Ultra Slim SelectBay of your PC drive slot, no additional unit to take on the road
    Dresser based on multiple drive in a compact design: DVD-RAM, DVD + RW, DVD + R, DVD - RW, DVD-R, DVD-ROM, CD, CD/R and CD
    Productivity:
    Backup of important files
    Easy access to CD and DVD based media
    Use for multimedia presentations
    Adapts to your lifestyle:
    Watch your favorite DVD movies
    Play music and games
    Create your own DVDs or music playlist
    Create CDs or DVs with ease
    Transfer data seamlessly between two discs, improve your productivity
    Reduce the time spent to transport and save files
    Slide-in simple, plug-and-play operation
    Includes drag ' n Drop CD + DVD3/B CLiP, Win DVD Creater 2 and the DVD-RAM driver
    Compatible with computer laptop Toshiba Portege M400, M405, S100 and Tecra S3

    Specifications

    Speed (Max):
    Read: 24 x CD-ROM, DVD-ROM 8 x
    Write: CD - R 24 x, CD - RW 4 x, 10 x HS CD - RW, 10 x US CD - RW, 2 x DVD-R, 2 x DVD - RW, DVD + R 2.4 x 2.4 x DVD + RW, DVD-RAM 2 x
    Compatibility: CD-ROM (read), CD-R(read/write), DVD - ROM (read), CD-RW(read/re-write), DVD-R(read/write), DVD-RAM(read/re-write), DVD-RW(read/re-write), DVD + R(read/write), DVD + RW(read/re-write)
    Dimensions and weight: 5 "x 5.5" x 0.4 ". 3.9 oz

    Hello

    According to the paper manuals s user for Portege M100 two drivers of optical discs are compatible with your Portege M100L:
    TOSHIBA SD-C2612
    TEAC DW-224TH

    So if you want to have good player get one of them.

  • Question about the extended international warranty for Qosmio F10

    Friends
    I bought a Qosmio F10 of UAE UNITED and it came with an international warranty of 3 years and its expiration time, December 12, 2007.
    I would like to know if someone has purchased an extended international warranty for Toshiba Qosmio F10 model.
    Please give me the details where can I buy the extended warranty.

    Concerning
    PVSRAO

    Hello

    Did you know that the Web of Toshiba Europe site?
    If not, then please visit this site:
    http://EU.computers.Toshiba-Europe.com

    You will find many interesting areas and in respect of the Services, you will find all the information on the guarantee of the uprisings, service and extensions.
    Generally each service partner Toshiba should be able to also give the warranty information and there, you could also buy extensions.

  • HP Envy 700-500z: Question about wi - fi antenna tower for the wi - fi signal booster

    Hello

    I bought a wi - fi turn antenna to boost my wireless signal so I can use my Tablet outdoors during the summer.  The instructions provided with the said Tower if the computer has built in wi - fi or wireless card, do not install the antenna tower software becauce it could cause a conflict.

    It was suggested to me that I could either turn off the card go in BIOS or go to network and sharing Center and change the settings of the map, right click on wireless icon, select Disable.  In this way, I could safely install the antenna tower software and use antennas to boost my wireless signal.

    I live in the mountains of NE PA, in a pretty remote area.  'Hot spots' are so rare.  I have no Internet DSL but the signal is not strong enough to reach my Tablet if I should be on the outside.  Even in one of the rooms, the signal is not all that strong.  So it would be great help for me, if I could push my wi - fi at least in the immediate area outside my house.

    Could someone tell me if the network settings can be sure to do, or I would return just the antenna of the tower.  I will not go into the BIOS because I fear of seriously harming my computer by doing this.  But a simple change in network settings, I'm pretty confident that I could.

    Thank you

    Sandra Knapp

    Hello Dave,

    Yes, I suppose I could do that, last spring, they have installed a new router and told me that he would have a stronger signal for wi - fi, but it did not help me using my Tablet out on the patio at all.  I couldn't get a signal here, nothing at all.  So I have a feeling they don't have anything stronger, but I could ask.

    Thank you for suggesting that.

    Sandie

Maybe you are looking for

  • Adding a hard drive to Time Capsule will increase storage space

    I have one capsule 3 TB and and get time capsule backup fails due to lack of space.  I have connected a 2 TB hard drive to time Capsule. But what will happen now?  Time machine will share back up to two discs automatically.  Or do I have to put somet

  • PhotoSmart 7525 - Broken EWS

    I've seen other threads on these forums that indicate that the firmware that elm1cn1434br is supposed to solve the problem of the EWS for printers Photosmart 7520. Unfortunately, this firmware is not available on the site http://support.hp.com for th

  • Windows xp pro usb install

  • startup message... Windows shut down to avoid damage

    locked system, when the previous stop, had to press the power button / stop... on said boot messages Windows has shut down to prevent damage to the computer, at the bottom of the screen, it says disable the driver and then update driver - says to dis

  • touchpad does not work on my laptop

    What to do if my touchpad does not work on my laptop. All keys work on the keyboard, but I can't move my pointer without the touchpad