Synchronized issue

Hi,
I have a synchronized block and Im sending a request to another application (blocking operation). So until i get response, I need to wait(), so that i wont end up consuming too much CPU. I want to wait() but i do also like to ensure that no other thread will enter this synchronized black in the mean time.
Because, i just want one thread to do this complete process and then only let the other thread come in.
I dont know how to stop other Thread acquiring lock while first thread is in waiting state.
..............Something..........
Collection col = null;
.........Some code.........
synchronized(lock)
     send(col);
     while(col == null)
          lock.wait();
     //Do further stuff     
void recieveResponse()
synchronized(lock)
     // col is populated
     lock.notify
}

You can always use a Semaphore or a Latch. Or better yet. Use a BlockingQueue with a Consumer-Producer pattern. Would that help?
while(col == null) {
gateLatch = new CountDownLatch(1);
gateLatch.await();
void recieveResponse() {
     synchronized(lock) {
           // col is populated
           gateLatch.countDown();
}

Similar Messages

  • Lightroom 2.5 Synchronizing Issue - Stops at 30%

    We updated to Lightroom 2.5 a couple of weeks ago and had no issues, until today. When we try to synchronize any folder (network folder), it stops at 30% and just sits there. The Synchronize button is still grayed out so we can not hit it yet. This is happening on all 3 network folders on 2 computers with lightroom. We have tried rebooting everything already.

    After letting lightroom just sit for a long time (half an hour or so), it advanced and let us synchronize.
    There have been no issues in the past. Adobe does need to learn how to make their software work inside of work environments (ie. networks).

  • Itunes-Ipod Synchronizing issues

    Hey ya'll,
    I have new mac book pro. However, it wont allow me to sync my ipod (which was originally configured to PC 4 years ago when I bought it), with my itunes, or vice versa, on the new mac. I have not exhausted my 5 allowable transfers, so I am stranded as to what the problem is and how to solve this? Please help. Thanks.

    What have you tried?
    What happened?
    Error message?
    What did it say?
    What ipod model?
    Any info?

  • Synchronous image display on external display

    Hi,
    I'm trying to get structural illumination microscopy using a LCoS spatial
    light modulator working. The modulator is controlled using DVI interface, and
    having no dedicated DVI capable hardware I'm stuck controlling the modulator
    using a dual video output desktop PC. I've developed a VI that executes
    following algorithm:
    1) Show grid 1 on external display
    2) Acquire frame 1
    3) Show grid 2
    4) Acquire frame 2
    5) Show grid 3
    6) Acquire frame 3
    7) Compute and store image
    8) Advance stage and repeat
    I'm using the External Display VIs form the Vision menu group to display the
    grids, and IMAQdx for the acquisition.
    The problem I'm having is that when this looping is slow enough, say 5 s,
    everything goes well, but when I optimized it and increased the speed, some of
    the acquired frames are wrong. After some tedious debugging I've think the
    problem is that shown images are delayed because of all the Windows fuss. There
    is no way of synchronizing the displayed image with the acquisition routine -
    after the image is "displayed" it's up for windows to actually
    display it.
    1) Is there a way to know that the image is actually drawn using IMAQ
    WindDraw VI ?
    2) Is there a better (as in faster, more predictable) way of showing a
    bitmap image on an otherwise empty external display?
    3) Maybe it is possible to control the external display using some kind of
    low level video driver functions (OpenGL, DirectX, the card is NVIDIA, fairly
    recent)?
    4) Maybe the right way to do it would be to play a looping video? And if so,
    how could this synchronizing issue resolved then.
    Any kind of input would be appreciated.
    lukas

    Hi,
    And thanks for the input. Yes, in fact we've made some progress, so I'll add some details on this problem. First the answers to A Person's questions:
    1) The loop rate when this issue occurs is about 2-5 fps.
    2) We are using a simple delay to throttle down the execution. Originally we intended to run this as fast as possible, so there was no need for specific execution speed.
    And our progress is as follows:
    1) As it appears and was confirmed by NI staff, we were unable to come up with any kind of workaround on the WindDraw method, so we're dropping it.
    2) We've developed an simple DLL using VisualBasic to load our three bitmaps into a form window placed on the external display. The shown on one or the other bitmap now happens with a simple call to the DLL to change the visibility of a particular bitmap. It seems to solve our initial problem. Also, if that isn't enough, we're considering an analogous DLL using OpenGL orthographic projection window using three bitmaps and triple buffering. The specific bitmap would be shown then just by offsetting the video memory buffer.
    3) The video idea was not that good after all I think. The advantage would still be fast DirectDraw accesses, but 2) method seems more reasonable.
    And a little bit off this topic:
    4) After solving this problem, we've encountered another. Now the camera acquisition isn't synchronized to the frame clock signal of the SLM. This produces a well known screen flicker seen on the TV when a computer or TV screen is filmed without a sync signal. Our camera, the Kappa DX4 274FW, has an external trigger connection, but the interface connection is a mini centronix. To be honest this is the first time I heard of it and it is next to impossible to get one for a reasonable price. Even if we could, there is no pinout nor the inner workings information concerning the trigger, the official site just states "External trigger". The official support is also ignorant. So that's thumbs down for Kappa. We've switched to Point Gray Chameleon camera, which has proper technical documentation on it's triggering functionality and the again present "we have and you don't, please buy from us" type connector was changed to a proper SMA connector with a bit soldering and drilling. The bad news is that the ActiveX interface used by this camera is using user defined return data types and some of the methods are grayed out when trying to call from LabView. According to
    http://digital.ni.com/public.nsf/allkb/27B959B430BA501486256A920071F567
    It wont and should not work, so now we're considering moving to VisualBasic completely. Again, it's worth mentioning that the initial problem could be solved using method 2), but this felt kind of connected and this "industrial connector hindering" business got me frustrated. So sorry for the lengthy post.

  • Lync 2013 - Address Book Synchronization Issues for External Users

    I recently deployed Lync Server 2013 in my organization. Everything works fine except for the address book synchronizing issues and the mobility access. I would really appreciate if someone could share their knowledge as I have done lot of troubleshooting,
    not sure if I have missed something. Please note my setup below for the External Web Services.
    Lync Front End:
    Listening: 8080 4443
    Published: 80 443
    I have published my External Web Services URL and the following ports are open: 4443, 443, 8080
    When I look at the Lync Client Configuration, ABS Server External URL is pointing to https://lyncexternalweb.domain.com:443/abs/handler. However, GAL Status is still pointing to my internal Front End FQDN: https://internal.domain.com:443/abs/handler.  
    For machines that are joined to the domain, the address books synchronizes with no issues. For machines that are not joined to the domain and for external users, GALContacts and GALContacts.DB files are not event generated for the users profiles. 

    Hi Anthony,
    Please note the findings below:
    1. I was checking the Lync Client configuration on one of the PC that is not joined to the domain, still on the domain network via site to site VPN connection. I noticed that the Connected Lync Server varies: sipinternal.domain.com, sipexternal.domain.com,
    lync.domain.com (Pointing to the Edge Server IP).  
    2. Edge Server External Settings: Single IP address with the FQDN set to lync.domain.com for all 3 services and the following ports configured. Access Edge Service: 5061, Web Conferencing Edge Service: 444, A/V Edge Service: 443 with NAT enabled public
    IPv4 address. I have checked the replication status between the Front End and Edge Server, it is up to date.
    3. In regard to the https://lyncdiscover.domain.com, I don't have the lyncdiscover.domain.com published, but it is pointing to the NAT enabled public IPv4 address which is assigned for A/V Edge Services.
    4. For the port forwarding, I am using the Cisco Meraki router. 
    Please advise if there are there is something that I am missing.
    Thanks!

  • A perplexing "put" problem... within CS6

    Dear Adobe Community,
    Recently, I have encountered a problem while trying to "put" files from my local view to the remote server using FTP. While some pages seem to upload successfully and can be seen when I open the internet browser to view my webpage, other pages seem to have content that is NOT being updated. When viewing the remote server folder, I can see that the page I have "put" looks great - it's updated and ready to go. But when I view that page in the browser, a different, older version appears.
    While "putting" the pages, the 'Background File Activity' window pops up and shows that, in fact, all the files associated with the page are being successfully transferred.
    I have downloaded the DW updates. I have deleted the browser cache. I'm stumped!
    Are there any Dreamweaver wizards out there that can help point me in the right direction?
    Thanks in advance for any help you can offer,
    Amy

    Hi Murray,
    Thank you for your response. I took a look, and I am definitely putting to the Remote Server. The weird part about the problem, is that I am able to "put" some of the pages without any difficulty and they will show up in the internet browser right away. Right now, I have one page that simply will not show up correctly in the browser. When I am viewing the pages in my Remote Server, the page in question is the most updated version and looks correct. If it looks good on the Remote Server, why do you think it isn't showing up in the internet browser as it should?
    Could this be some type of synchronizing issue? Earlier I changed the following settting... would you recommend changing it back?
    Site Setup --- Server --- Advanced --- 'unchecked box' for 'maintain synchronization information'
    Let me know what you think and, again, thanks for taking the time to reply today : )
    Amy

  • Mapping error in PI 7.4 dual stack

    Dear Experts,
        Recently we upgraded our system from PI 7.1 to PI 7.4 dual stack.
    Scenerio is ECC->PI->SOAP(Webservice) synchronous
    Issue in detail:
         We are creating a invoice in ECC system through PI its updating in third party site using SOAP webservice and will get a reference number from that site and then updating in ECC as in synchronous way.
    Invoice data's are reached PI sucessfully from ECC but it not updating in the site and getting below mapping error after upgarded to PI 7.4.
    Your points will be highly appreciable.
    Kindly help to sort out this issue.
    Best Regards,
    Monikandan

    Hi Monikandan,
    It seems you are trying the sign the payload in your java mapping. So, looking at the attached error, there could be 2 possibilities:
    1) Either there is no certificate with alias: *_PRD
    2) This certificate is stored in some "System" type keystore view which is not accessible from you mapping code. Try to move your certificate to some "User" keystore view.
    Thanks & regards,
    Piyush

  • Java.lang.IllegalStateException: Cipher not initialized during loadtest

    Hi All,
    Below is my code :
    static Cipher pbeCipher;
         byte[] encbytes = hexToByte( encrypted );
         pbeCipher.init( javax.crypto.Cipher.DECRYPT_MODE, pbeKey, pbeParamSpec );
    byte[] decbytes ;
    synchronized (pbeCipher) {
         decbytes = pbeCipher.doFinal( encbytes );
              return new String( decbytes );
    I got the below exception when we are actually performing the load tests where in 4000 hits are made on the code in 1 min.
    java.lang.IllegalStateException: Cipher not initialized
    at javax.crypto.Cipher.c(Unknown Source)
    at javax.crypto.Cipher.doFinal(Unknown Source)
    My doubt here is : Is it occuring becuase of synchronizing issue? As shown in the code above i had synchronized the doFinal call. Still the exceptions are occuring. These are randomly coming say 1 out of 500 hits.
    Please suggest me a solution on how to fix this. We are using PBEWithMD5AndDES encryption mechanism in this case.
    Solution for this would help me a lot in terms of fixing it...
    Thanks in Advance......

    Cipher is not thread safe so that is almost certainly your problem. Your synchronisation does not include the init() method so it is possible that the instance is being initialised in one thread and used for decryption in a different thread.
    My approach is to create a pool of Cipher instances and then get an instance from the pool, use it and then put it back in the pool.
    P.S. DES is now considered deprecated in favour of AES. PBE is a poor man's approach since the chances are the password has far less entropy than the key size so will be much weaker than that implied by the algorithm being used. PBE is normally used for securing a user's data so in a Web based application it normally does not make sense to use PBE.

  • Generate FLV with sound

    Hello
    Air application is generating FLV videos out of supplied images.
    It is using this class:
    http://www.zeropointnine.com/blog/simpleflvwriteras-as3-class-to-create-flvs/
    When I add sound to the video it seems that it has synchronizing issues - audio appears at the end of the video.
    The problem is in writing audio bytes to the FLV file
    Any suggestions or at least links where to look for the solution?
    Thank you in any case!

    I had this problem before. I found that if the VideoDisplay
    component had not finished all inititialization functions before I
    assigned the new flv, then I got sound with no video. Try listening
    for creationComplete for your VideoDisplay component before you
    assign the video source to see if that solves your problem.
    Vygo

  • Workspace 2010(Groove): Not syncing changes or new documents

    Hello
    we are having the following two issues:
    1) User A added a word document to a space.
    User B can not see the document.
    User A and other Users can see and open the document just fine.
    User B already deleted the Space and downloaded it again.
    2) User A edits a excel sheet.
    User B the same sheet.
    But the sheets do not sync. THe Users only see the changes they make themselves.
    Sorry for my English, but can you help?
    OS is Windows 7 with latest patches. Office 2010 also with latest patches.
    THanks

    Hi David,
    I understand you are using Groove workspace 2010 and now encountering synchronizing issue. Please refer to the article below and check if User B get "suspended" from the workspace.
    If that is the case, please try one of the following:
    Download the synchronized workspace data from another computer (if you have
    your account on more than one computer) or from another workspace member.
    Request a new invitation to the workspace from another workspace member. You might make this request simply by sending a message or e-mail.
    https://support.office.com/en-in/article/Managing-workspace-synchronization-problems-in-SharePoint-Workspace-2010-07763d41-7aec-4531-bb2d-81431f01245b?ui=en-US&rs=en-IN&ad=IN
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • My ipod touch is going weird while playiong videos

    i have an ipod touch and i have several videos/movies on my ipod... for some reason they seem to be auto deleting themselves without me even plugging my ipod to my comp..and also when im playing a video/movie the screen will turn green and all i get is the sound if i restart the video sometimes it fixes itself....?? ive reset it and also restored it several times i dont think its the vids as the movies i ripped strait from dvd's to my ipod sometimes they play ok and other times they screw up. im running the latest 1.1.2 software on it aswell :S
    Message was edited by: shannon107

    I don't know about your deleted files but I suspect it was due to synchronizing issue. With regard to your funky video, I think you may have protective case on your iPT that squeeze the touch screen too tight. As a result, it causes the screen to malfunction. Get rid off your protective case and reset your iPT and you may get your video back (and that was what happened to me when I put a Griffin case on my new iPT).
    Hope this work for you.

  • Bypass dropbox decryption on ASA CX

    Hi, 
    I have a client with ASA 5515-X and CX module for URL filtering and AVC. All the users have dropbox or google drive and in this moment present synchronism issues; we can identify that the problem is on the decrypt policies; the user guide for ASA CX ver 9.3 indicate that this problems may occur and the solution is:
     Create objects that identify the destination of the traffic. For HTTPS, you can use URL objects; for other types of TLS traffic, use network objects.
    Create a decryption policy that uses the object as the destination and apply the Do Not Decrypt action. Ensure that the policy is higher in the policy set than any policies that would apply decryption processing on the same traffic.
    source: http://www.cisco.com/c/en/us/td/docs/security/asacx/9-2/user/guide/b_User_Guide_for_ASA_CX_and_PRSM_9_2/prsm-ug-cx-decryption.html#task_885A6AD45CE54E63ABDE9F771669EFE0
     But the problem is when I try to create objects for bypass decryption policies, in CX the only objects types available in the decryption policies are:
    network object
    network object group
    CX network group
    URL object
    destionation object group
    I use a network object with the FQDN dropbox.com, but this can’t be effective for bypass the encryption policy “decrypt everything”; obviously I can’t bypass based on application objects (it’s not available on the bypass objects options), what is the best option for discriminate the dropbox traffic on the decryption policies?

    You only need that in the case where you have an enterprise PKI and something like Windows certificate services as your CA and issuing trusted certificates for your servers. The clients trust that root CA and any certificates signed by it.
    So if the CA issues an intermediate certificate to the ASA CX, your clients will in turn trust the CX without further exceptions / certificate store settings being required.

  • How can we restart the  Error Messages

    Hi,
             I have a Secnario like  JDBC- To - RFC(R/3)   .. here my Receiver(R/3 system was down in particular time..  so, the messages was  not processed successfully..
    but after the R/3  server was up .. the  remaing messages are processed normally.. except the   those messages are failured in that particular time server was down..
    if  I saw in SXMB_MONI.. the message was showing  (system error--  System Error - Restart is not possible... )   so, how can we  solve this issue..
    How can we restrt the  messages  from SXMB_MONI..
    Regards
    jain

    Hi Jain,
    You cant restart the synchronous messages nor u can restart it............Hence the messages regarding synchronous issues cant be solvable.....The only way you have is to Resend the same data by again posting it in the Outbound Folder (Outbound side or sender side).........So once the sychrouns message failed means then it is unslovable ......So just follow the above mentioned way of resending the data by posting in the Out folder......................
    Reward with points if helpful
    Regards
    Sai

  • Repository limitations

    Hi all,
    What do you feel is the practical limitation for the number of developers
    that can be supported in a single repository? Are there other factors that
    play heavily in the limitation, such as server platform, or frequency and
    timing of integrations and updates?
    I am interested in hearing some real-world experiences with larger
    development teams, plus any tricks and suggestions for dealing with the
    concurrency and synchronation issues if it does become necessary to split
    into multiple repositories.
    Thanks in advance for your input,
    Jeanne
    =========================================
    Jeanne Hesler <[email protected]>
    MSF&W Software, Product Development
    (217) 698-3535 ext 207
    http://www.msfw.com
    =========================================
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    We have around 12 developers working on the same repository. This is about
    as many as you would want. I think that it would be better to keep it under
    10 if possible. We have had performance problems with the update, compile
    and integration cycle as the repository has increased in size. We got
    around this to some extent by bumping the memory on the development
    workstations to around 96 MB and by running update/compiles on the server
    using fscript.
    David Campbell,
    CSC Australia
    To: [email protected]
    cc: (bcc: David Campbell/AUST/CSC)
    From: [email protected]
    Date: 01/01/99 01:55:23 AM GMT
    Subject: repository limitations
    Hi all,
    What do you feel is the practical limitation for the number of developers
    that can be supported in a single repository? Are there other factors that
    play heavily in the limitation, such as server platform, or frequency and
    timing of integrations and updates?
    I am interested in hearing some real-world experiences with larger
    development teams, plus any tricks and suggestions for dealing with the
    concurrency and synchronation issues if it does become necessary to split
    into multiple repositories.
    Thanks in advance for your input,
    Jeanne
    =========================================
    Jeanne Hesler <[email protected]>
    MSF&W Software, Product Development
    (217) 698-3535 ext 207
    http://www.msfw.com
    =========================================
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • RE: repository limitations

    Hello:
    I think we reached the limits of number of developers per repository. We
    have approximately 20 (or over) developers connected to one repository.
    Breaking a repository, if one is working from base projects that are used in
    one huge development application (consisting of several projects), will pose
    a challenge unless one is very critical in the designing of such an
    application from day one. Our developers are local as well as remote.
    Most of our clients are 128 MB NT Workstations. All our developers are
    advised to use the -fm flag and set the minimum and maximum memory limits.
    Our developers are also encouraged to use shadows and compile on updates
    which integrates compiled projects into the base. This is recommended by
    Forte for performance gain ( keeping the base compiled). Our repository (on
    NT server) is above a gigabyte consistently and we clean it nightly. Not
    cleaning it consistently means a threat of the repository reaching its 2GB
    limit whereby no activity can be performed on it except exporting and
    recreating it.
    Splitting a repository is entirely a design issue at this point, and
    synchronizing ( even at a scripted level) does not work like synchronous
    replication. You will not have a choice but to have difference in code if
    you are using base projects in both repositories.
    Good luck, and let me know if you find any breakthroughs.
    Mohamed Nasser.
    Systems and Database Engineer
    Descartes Systems Group Inc.
    -----Original Message-----
    From: Jeanne Hesler [SMTP:[email protected]]
    Sent: Thursday, December 31, 1998 8:55 PM
    To: [email protected]
    Subject: repository limitations
    Hi all,
    What do you feel is the practical limitation for the number of developers
    that can be supported in a single repository? Are there other factors
    that
    play heavily in the limitation, such as server platform, or frequency and
    timing of integrations and updates?
    I am interested in hearing some real-world experiences with larger
    development teams, plus any tricks and suggestions for dealing with the
    concurrency and synchronation issues if it does become necessary to split
    into multiple repositories.
    Thanks in advance for your input,
    Jeanne
    =========================================
    Jeanne Hesler <[email protected]>
    MSF&W Software, Product Development
    (217) 698-3535 ext 207
    http://www.msfw.com
    =========================================
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>-
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Hi Sandra,
    You have to look into your Repository Design Model for optimized MDM performance like fields in main table, sub-tables, look-up fields, Tuples etc. Refer SAP Note,  1012745 - Tips for improving MDM performance
    https://websmp130.sap-ag.de/sap/support/notes/1012745
    Also refer, http://wiki.sdn.sap.com/wiki/display/SAPMDM/EfficientRepositoryDesigninginMDM
    For Data volume, you have to look into how many number of records are you going to maintain in MDM repository, accordingly you need to do Sizing, refer Sizing Guide for more details:
    https://websmp109.sap-ag.de/~sapidb/011000358700001921872008E
    Hope this helps..
    Regards,
    Mandeep Saini

Maybe you are looking for