Race conditions with UI thread

Hi community,
the update to LabVIEW 2014 has caused sveral of my vis to act up - vis that I had coded with race conditions with the UI thread that I was not aware of.
Maybe they didn't exist previously, maybe I was just ignorant.
Here is a where I first noticed something was wrong. It has a workaround inside:
http://forums.ni.com/t5/LabVIEW/How-to-make-sure-plots-in-xy-graph-are-present/td-p/3033109
Thanks again Norbert for your help with that.
Now problems are showing up in other places too and it might be the tip of an iceberg. I'm a little afraid right now. It's not just xy graphs. The latest example:
I have a sub-vi whose frontpanel I open with an invoke node inside that sub-vi. Afterwards, in the caller I register for events of frontpanel objects of the sub-vi. This fails now - apparently the fp of the sub-vi isn't open yet although the sub-vi has finished executing (yes, I use dataflow to ensure register for event is done only after the sub-vi has finished). This has a striking resemblance to my issue in the previous thread. It seems that vis can now be "finished" executing while stuff that was supposed to happen inside the sub-vi is still executing in the UI thread.
I had not expected this.
Is this intended behaviour?
Is this new to LabVIEW 2014?
Can someone please shed some light on this behavior change (if indeed it is one)?
Can someone please advise me on a general solution/workaround for the host of problems this is causing me?
Best regards
Florian

Norbert,
I'm currently unable to reproduce the issue in my code regardless of cpu core affinity (you gotta hate random errors).
I have attached an example that shows a simplified version of the code that has previously produced the error.
This example might be flawed since it hasn't produced the error yet.
The issue would show when the button "open window" is pressed, if it did at all.
Also there is stuff in there that I just implemented in an attempt to keep the UI thread busy.
For the core of the issue please disregard the bottom while loop in caller.vi
I'll keep trying.
Best regards
Florian
Attachments:
subvi event registration.llb ‏56 KB

Similar Messages

  • [svn:fx-trunk] 12795: Resolving race condition with interdependent Group properies alpha and blendMode .

    Revision: 12795
    Revision: 12795
    Author:   [email protected]
    Date:     2009-12-10 09:56:11 -0800 (Thu, 10 Dec 2009)
    Log Message:
    Resolving race condition with interdependent Group properies alpha and blendMode.
    QE notes: None
    Doc notes: None
    Bugs: SDK-24636
    Reviewer: Deepa
    Tests run: Checkin
    Is noteworthy for integration: No
    Ticket Links:
        http://bugs.adobe.com/jira/browse/SDK-24636
    Modified Paths:
        flex/sdk/trunk/frameworks/projects/spark/src/spark/components/Group.as

  • Custom Tag in race condition with OC4J v9.0.2.0.0...

    Hello all,
    (I tried deploying my application with OC4J 9.0.3 but none of my existing
    tags worked)
    I developed a OC4J web application implementing my own tag library extension
    and found out that there was occurring a race condition to the fact that two
    users (different sessions) where accessing the same
    tag at the same time. In the offending tag implementation I only have
    instance members and not static which could also cause a
    concurrent access problem.
    I found that OC4J was reusing concurrently the same
    Tag instance when it should not do that!!!
    public class pagesIteratorTag extends BodyTagSupport {
    // only instance class members...
    public void doInitBody() throws JspException {
    System.out.println("pageSetIteratorTag::doInitBody - Tag instance value: " + this.toString() + " for user: " + this.pageContext.getSession().getAttribute("j_username"));
    public int doAfterBody() throws JspException {           
    System.out.println("pageSetIteratorTag::doAfterBody - Tag instance value: " + this.toString() + " for user: " + this.pageContext.getSession().getAttribute("j_username"));
    Note the pagesIteratorTag@2e same instance is used when it should not
    1 because the tag instance should be protected from multiple concurrent
    access even though it can be pooled and reused if it is free.
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Frank
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Frank
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doInitBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    pageSetIteratorTag::doAfterBody - Tag instance value: com.kdlabs.fogal.tagext.pagesIteratorTag@2e for user: Giovanni
    Session for user Frank throws a null pointer exception because Giovanni's session
    started accessing the variable.
    Can anyone advise please?
    Best Regards,
    Giovanni

    First of all, you said none of your tags worked in 9.0.3. What happened? Did you do any debugging of the problem?
    Comparing the "toString()" output of your tag does not guarantee they are the same instance. That is just the output of "hashcode()", not the "pointer" to the object. The hashcode is generated from the contents of the object, not its "identity".
    I suggest you track the NPE in the debugger and get more information before you assume the container is at fault (which is still an outside possibility). SDK API Javadoc
    Object class:
    The general contract of hashCode is:
    1-. Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
    So, the toString() is properly returning the suffix of the object instance
    number unique for that instance and is then being reused by OC4J even though
    it is being accessed from another session thread, that must not happen and it
    is not compliant with the JSP spec.
    The other history is that when I implemented my custom tags OC4J was JSP 1.1 compliant
    and not 1.2, so after moving to 1.2 the scripting variables can be defined in XML and
    by subclassing TagInfo class, the last option doesn't work with OC4J 9.0.3, not good...
    Thanks for your help,
    I will keep trying to figure out what the problem migth be,
    Best Regards,
    Giovanni

  • EMET 5.0 Group Policy Settings Ignored (Probable race condition with Policy application)

    In our deployment, EMET 5 seems to be ignoring group policy settings from immediately after the first group policy refresh post-boot.
    Settings are being applied to the computer correctly, and are appearing in the registry correctly, and on boot, a set of Event ID 50 events are logged containing ConfigAppmitGPO (and similar for the other settings) elements with the correct settings.
    Upon the first group policy refresh, further eventID 50 events are logged, with empty ConfigAppmitGPO elements.
    Investigation with Process Monitor seems to indicate this is a race condition between Group Policy Registry settings being refreshed (which deletes the entries) and the EMET service reading out these settings from the registry (which appears to be triggered
    by Group Policy application or by a notification on the registry keys themselves)
    This is reproducible on Windows 7 and Windows 8.1.
    Is there any way to arrange for settings to be applied correctly at all times, or is this a bug that will need to be fixed in a future update?

    We're experiencing the exact same behavior currently. I was starting to think I was going crazy. Glad to know others are experiencing the same behavior.
    I've found that using the method from pervious versions to read and update settings from Group Policy, using "emet_conf.exe --refresh" still works, and upon every execution, the event log shows the GPO settings being read and applied. While I welcome the
    move to have EMET update from GPO settings without requiring running a separate task, as it stands now in its current condition, it is a step back.
    Scott Ladewig http://www.ladewig.com

  • Race condition with Startup scripts and 2nd locally mounted hard drive?

    Hello,
    My main hard drive is a solid state drive that I have OS 10.6.6 installed on. I also have a secondary local drive that I have installed some applications to.
    When my system boots I have some scripts in /Library/StartupItems that run before any users log in. Some of the scripts attempt to launch applications that are stored on my second disk. I have discovered that when my StartupItems run, the second disk has not yet had the opportunity to mount! As a result, my scripts fail of course.
    I discovered this by adding the command "mount > /info.txt" to my startup scripts that were not working as expected.
    If I insert sleep statements in my scripts that buys them enough time to allow my second drive to mount before they actually perform their useful tasks.
    All of this being said can anyone advise what a more appropriate solution would be? Is there a way to arrange the OS mechanisms in a way that would cause all disks to mount before aany StartUp scripts are run?

    There are a couple of ways you can do this. The "right" approach is to use DiskArbitration, but that's not easy to do from a shell script. I'd suggest converting your job to launchd (StartupItems are deprecated). Check out Technical Note 2083 (http://developer.apple.com/library/mac/#technotes/tn2005/tn2083.html) for more information than you ever wanted on daemons and agents on Mac OS X.
    launchd can be a bit daunting if you've never used it before, but it offers a lot of flexibility -- in particular the StartOnMount key. Your job can be triggered whenever a new disk is mounted. From there you can check for the presence of your expected volume, and exit if it's not present. (There is a small race condition here: if the disk mounts after your check but before you exit, you could miss it and fail to run. Also, you may not be able to predict the mountpoint of your disk in certain cases. You might instead want to check that its UUID matches what you expect. You can process the output of diskutil(8) to get the volume UUID.)
    Check out the example property list at the bottom of launchd.plist(5). Give it a custom label, specify the path to your script in ProgramArguments, and replace the KeepAlive key with StartOnMount. Set permissions to something like 644 with ownership root:wheel, drop into /Library/LaunchDaemons, and you should be good to go on your next boot. (By convention, the file's name should be the same as your label followed by ".plist".)

  • What is dead locks with oracle and wht is race condition wrt oracle

    what is dead locks with oracle and wht is race condition wrt oracle

    > And do you know what a race condition is all about?
    It is a term used to indicate several processes attempting to use the same resource that is not capable of servicing all these at the same time. This could be due to the resource not being thread safe or implemented as a serialised resource.
    It is often easy to look up definitions on Google. In the Google search field, type "define:race condition".
    The following [url http://www.google.co.za/search?hl=en&q=define%3Arace+condition&btnG=Google+Search&meta=]web definitions page is displayed.

  • Problems debugging multiple threads to test race conditions

    I was trying to use JDeveloper 10.1.3 to debug race conditions (in the Embedded OCJ4 Container) and was not able to get the degree of control over multiple threads that I had hoped. I was able to trap a break point where I see two active request threads in the Threads window, and I am able to select each thread individually and see the current line of code that each is currently on. However, if I use the debugger controls to step a line of execution on one of the threads, the execution point also seems to change on the other thread.
    In some other IDEs I have used concepts like "freezing" and "thawing" threads which provide fine grain control over debugging race conditions. Is anyone aware of a similar concept in JDeveloper that I might just not be aware of? Instead it just seems that debugger has either paused the JVM or else plays all threads while only bounding particular thread you have focus on to the number of execution steps you specified (step into, step over, step out of, ...).
    Thanks.

    There are some developers that have mentioned this to me also.
    It appears to be possible in eclipse however, but not JDeveloper. Can anyone verify this, and hopefully give us a work around?
    Thanks,
    Tony

  • Is a functional global with loops inside case structure subject to race condition?

    Such as this one:
    Solved!
    Go to Solution.

    bmihura wrote:
    I'm being a bit dense here... would somebody write an example VI that demonstrates how functional global variables eliminate race conditions whereas a normal global variable would not? Or just describe it and I'll write the VI?
    The classic example used is a bank account.  Say you are making a deposit.  You have to read the current balance, add the deposit amount, and save the balance.  Now say you are making a withdrawal.  You have to read the current balance, subtract the withdrawal amount, and save the new balance.  Now let us say that both of these events happen at the same time.
    If you are using global variables, you read the global, perform the action, and save to the global.  But who reads what balance.  If both events read the balance at the same time, then whoever writes last will overwrite the other's action.  This is bad, especially if your deposit "didn't happen".
    Now using a FGV (or Action Engine), you can contain the critial parts of the code.  In this case the critical parts are the full read, act, and write.  So with the AE, you store the balance in a shift register.  You can perform whatever action you want inside of the AE VI.  Because the AE is not reentrant, only 1 action can be performed at a time.  So you make sure that deposit happens and is not overwritten by the withdrawal.
    Now for my caveat.  If all you do is a Get and Set inside of the FGV, it is basically a global variable, just slower.
    Read that acticle I linked to earlier and also read up on the Action Engine nugget.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to prevent race conditions in a web application?

    Consider an e-commerce site, where Alice and Bob are both editing the product listings. Alice is improving descriptions, while Bob is updating prices. They start editing the Acme Wonder Widget at the same time. Bob finishes first and saves the product with
    the new price. Alice takes a bit longer to update the description, and when she finishes, she saves the product with her new description. Unfortunately, she also overwrites the price with the old price, which was not intended.
    In my experience, these issues are extremely common in web apps. Some software (e.g. wiki software) does have protection against this - usually the second save fails with "the page was updated while you were editing". But most web sites do not
    have this protection.
    It's worth noting that the controller methods are thread-safe in themselves. Usually they use database transactions, which make them safe in the sense that if Alice and Bob try to save at the precise same moment, it won't cause corruption. The race condition
    arises from Alice or Bob having stale data in their browser.
    How can we prevent such race conditions? In particular, I'd like to know:
    What techniques can be used? e.g. tracking the time of last change. What are the pros and cons of each.
    What is a helpful user experience?
    What frameworks have this protection built in?

    Hi,
    >> Consider an e-commerce site, where Alice and Bob are both editing the product listings. Alice is improving descriptions, while Bob is updating
    prices. They start editing the Acme Wonder Widget at the same time. Bob finishes first and saves the product with the new price. Alice takes a bit longer to update the description, and when she finishes, she saves the product with her new description. Unfortunately,
    she also overwrites the price with the old price, which was not intended.
    This is a classic question that you can find in any developing exam :-)
    there are several options according the behavior that fit your needs, and several points that need to be taken into consideration.
    1.  Using locking in the application side, you can make sure that two people do not open the same product for editing. this is in most cases the best option.
    * I am not talking about
    thread-safe but the implementation is almost the same. The locking can be done using singleton class and have a static boolean element. Every time a user want to edit we check this value as first action. If the value is false then we lock the and
    change it to true -> do what ever we need -> change the value to false -> unlock.
    Behavior: First person that try to edit lock the product and the second get a message that this product is unders editing. In this case you do not open connection to database and your application prevent any problem.
    2. Using "read your writes", as mentioned
    Behavior: this mean that several people can open the same product for editing, and only when they try to send it to server they get a message telling them that they have waist their
    time and someone else already change the product information. At this point they have two option: (1) overwrite what the other person did, (2) start from the beginning.
    This is the way most WIKI websites work.
    3. Using real-time web functionality like SignalR, WebSocket, or any streaming for example. In this case you can send the person that work on the edit a message like "this product have already been edit" and stop give him the extra time to
    think what you want to do. You will need to use one of the above option maybe, but since the user get the information in real time he have time to chose.
    4. Using "Change before Write" or "read before edit": The idea is to have a column that point if the row is in use. the type of this column should be same as the user unique column type. Before the user start you check the value
    of this column. If it is 0 then you change it to the user unique value (for example user_id), If the value was not 0 then you know that someone else is editing the product. In this case the locking is managed in the database. make sure that you work with transactions
    while reading the value and changing it! you can change the default from share lock to X lock as well during this action, if you really want.
    There are several other option, if those do not fits your needs
      Ronen Ariely
     [Personal Site]    [Blog]    [Facebook]

  • How does a global cause a race condition?

    Hello All,
                 I am learning about variables and realised I havent used globals and have started to investigate for a project. I am aware theres the standard global and lv2 globals, the lv2 are preferred as they dont cause a race condition. I hope I am right in thinking the race condition could be seen by opening 'System Monitor' which would indicate 100% CPU usage.
    Could someone explain how the global causes a race condition and why the lv2 global doesnt cause one. Ideally a code snippet if possible please.
    Many Thanks
    Regards
    Chris

    Race conditions most often occur when multiple threads or processes are reading and writing to a single data value. Notice I said reading and writing since having a single writer will alleviate this problem. Here is an abstract example to consider:
    Lets say that your bank stores your account balance in is single global called BALANCE, and both you and your spouse have an ATM card to this account.  When you use the card it calls the withdraw function (BALANCE = BALANCE - cash)  if either you or your spouse uses the card there is no problem but what if you both use it at the same time deciding to withdraw $200.00 each?
    you both read the BALANCE variable which lets say is $1000.00.  You decrement your copy of the balance BALANCE = 1000 - 200 and update the variable with the new balance.  The final amount will be $800.00 but it should have been $600.00.  Ironically you might think the global saved you $200.00 but it does yield the wrong answer.  If you can avoid using globalization then avoid it.  Especially in LABVIEW where you have a data flow model of programming globals break the flow of data and can often be replaced with other data communication methods which provide a higher degree of synchronized data flow like queues.  If you are seeing nondeterministic results (looks random) this is a sign that you have uninitialized variables (rare in Labview) or you have a race condition.  Hope this example helped some,
    Paul
    Paul Falkenstein
    Coleman Technologies Inc.
    CLA, CPI, AIA-Vision
    Labview 4.0- 2013, RT, Vision, FPGA

  • WebLogic JMS client frozen during JMS connection stopping (race condition)

    Hello,
    Our application is using the WebLogic 10.3.1 JMS client generated with wlfullclient5.jar.
    We have sometimes a race condition when the WebLogic server is stopped.
    In about 10% of the cases where the server is stopped, the client application is frozen in the "stop" call (see stack trace #1 below).
    Our understanding is that each JMS API call by the application is translated by a request-response message on the TCP connection to the JMS server. The JMS library sends the request and then wait for the response. From our observations, it looks like there is no local timeout in the JMS library. This means that if the WebLogic server is being stopped just after receiving the "stop" request, it will never send the "stop" response, which means that the application will be stuck forever.
    The same problem also occurs when using JMS bridges between 2 JMS servers (see stack trace #2 below).
    How can we activate a local timeout for all JNDI/JMS calls ?
    Regards,
    metatech
    "AppThread" prio=3 tid=0x0000000100117800 nid=0x2 in Object.wait() [0xffffffff7befe000]
    java.lang.Thread.State: WAITING (on object monitor)
    at java.lang.Object.wait(Native Method)
    at java.lang.Object.wait(Object.java:485)
    at weblogic.messaging.dispatcher.DispatcherWrapperState.triggerPeerGoneAndWait(DispatcherWrapperState.java:607)
    - locked <0xffffffff7509aee8> (a weblogic.messaging.dispatcher.DispatcherWrapperState)
    at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSyncTran(DispatcherWrapperState.java:349)
    at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSyncNoTran(DispatcherWrapperState.java:386)
    at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSync(DispatcherWrapperState.java:252)
    at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSync(DispatcherAdapter.java:43)
    at weblogic.jms.client.JMSConnection.stop(JMSConnection.java:758)
    - locked <0xffffffff7509a640> (a weblogic.jms.client.JMSConnection)
    at weblogic.jms.client.WLConnectionImpl.stop(WLConnectionImpl.java:722)
    at AppSession.closeJMSSession(ConnectorSession.java:499)
    "[ACTIVE] ExecuteThread: '12' for queue: 'weblogic.kernel.Default (self-tuning)'" waiting for lock weblogic.jms.client.JMSXASession@1d363e4 WAITING
    java.lang.Object.wait(Native Method)
    java.lang.Object.wait(Object.java:485)
    weblogic.jms.client.JMSSession.waitForState(JMSSession.java:4778)
    weblogic.jms.client.JMSSession.stop(JMSSession.java:1310)
    weblogic.jms.client.JMSConnection.stop(JMSConnection.java:773)
    weblogic.jms.client.WLConnectionImpl.stop(WLConnectionImpl.java:722)
    weblogic.jms.adapter.JMSBaseConnection.closeInternal(JMSBaseConnection.java:570)
    weblogic.jms.adapter.JMSBaseConnection.access$000(JMSBaseConnection.java:85)
    weblogic.jms.adapter.JMSBaseConnection$2.run(JMSBaseConnection.java:552)

    Hi Tom,
    Thanks for looking at the issue.
    I tried to post the full thread dump as an attachment, but it is not allowed by the forum, so you find it hereunder.
    Regards,
    metatech
    =================
    2010-05-28 12:33:19
    Full thread dump Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode):
    "Attach Listener" daemon prio=3 tid=0x0000000100c5b800 nid=0x24 waiting on condition [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE
    "ExecuteThread: '0' for queue: 'JmsAsyncQueue'" daemon prio=3 tid=0x0000000100759800 nid=0x23 in Object.wait() [0xffffffff643ff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:485)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:91)
         - locked <0xffffffff6f4ed828> (a weblogic.kernel.ServerExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:115)
    "Timer-0" daemon prio=3 tid=0x000000010078c800 nid=0x21 in Object.wait() [0xffffffff647ff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         - waiting on <0xffffffff6f4ee2c0> (a java.util.TaskQueue)
         at java.lang.Object.wait(Object.java:485)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0xffffffff6f4ee2c0> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "weblogic.timers.TimerThread" daemon prio=3 tid=0x00000001008e0000 nid=0x20 in Object.wait() [0xffffffff649ff000]
    java.lang.Thread.State: TIMED_WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at weblogic.timers.internal.TimerThread$Thread.run(TimerThread.java:267)
         - locked <0xffffffff6f4e75d0> (a weblogic.timers.internal.TimerThread)
    "ExecuteThread: '3' for queue: 'default'" daemon prio=3 tid=0x0000000100709000 nid=0x1e waiting for monitor entry [0xffffffff65afe000]
    java.lang.Thread.State: BLOCKED (on object monitor)
         at weblogic.jms.client.JMSConnection.stateChangeListener(JMSConnection.java:1413)
         - waiting to lock <0xffffffff7509a640> (a weblogic.jms.client.JMSConnection)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.run(DispatcherWrapperState.java:682)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.timerExpired(DispatcherWrapperState.java:617)
         at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
         at weblogic.work.ExecuteRequestAdapter.execute(ExecuteRequestAdapter.java:21)
         at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:145)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:117)
    "ExecuteThread: '2' for queue: 'default'" daemon prio=3 tid=0x000000010055c800 nid=0x1d in Object.wait() [0xffffffff65cff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:485)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:91)
         - locked <0xffffffff6f427a80> (a weblogic.kernel.ServerExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:115)
    "ExecuteThread: '1' for queue: 'default'" daemon prio=3 tid=0x000000010055c000 nid=0x1c in Object.wait() [0xffffffff65eff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:485)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:91)
         - locked <0xffffffff6f427da0> (a weblogic.kernel.ServerExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:115)
    "ExecuteThread: '0' for queue: 'default'" daemon prio=3 tid=0x00000001006fa800 nid=0x1b in Object.wait() [0xffffffff660ff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:485)
         at weblogic.kernel.ExecuteThread.waitForRequest(ExecuteThread.java:91)
         - locked <0xffffffff6f4280c0> (a weblogic.kernel.ServerExecuteThread)
         at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:115)
    "StateHolder" daemon prio=3 tid=0x0000000100584800 nid=0x1a waiting on condition [0xffffffff66aff000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
         at java.lang.Thread.sleep(Native Method)
         at StateHolder.run(StateHolder.java:80)
         at java.lang.Thread.run(Thread.java:619)
    "Thread-1" daemon prio=3 tid=0x0000000100554000 nid=0x18 waiting on condition [0xffffffff66cff000]
    java.lang.Thread.State: TIMED_WAITING (sleeping)
         at java.lang.Thread.sleep(Native Method)
         at org.apache.log4j.helpers.FileWatchdog.run(FileWatchdog.java:104)
    "Low Memory Detector" daemon prio=3 tid=0x00000001003d3800 nid=0x16 runnable [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE
    "CompilerThread1" daemon prio=3 tid=0x00000001003cf000 nid=0x15 waiting on condition [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE
    "CompilerThread0" daemon prio=3 tid=0x00000001003cd800 nid=0x14 waiting on condition [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE
    "Signal Dispatcher" daemon prio=3 tid=0x00000001003cb800 nid=0x13 runnable [0x0000000000000000]
    java.lang.Thread.State: RUNNABLE
    "Finalizer" daemon prio=3 tid=0x00000001003a4800 nid=0x12 in Object.wait() [0xffffffff680ff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
         - locked <0xffffffff6f4c7670> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=3 tid=0x00000001003a3000 nid=0x11 in Object.wait() [0xffffffff682ff000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:485)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
         - locked <0xffffffff6f401370> (a java.lang.ref.Reference$Lock)
    "Worker" prio=3 tid=0x0000000100117800 nid=0x2 in Object.wait() [0xffffffff7befe000]
    java.lang.Thread.State: WAITING (on object monitor)
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:485)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.triggerPeerGoneAndWait(DispatcherWrapperState.java:607)
         - locked <0xffffffff7509aee8> (a weblogic.messaging.dispatcher.DispatcherWrapperState)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSyncTran(DispatcherWrapperState.java:349)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSyncNoTran(DispatcherWrapperState.java:386)
         at weblogic.messaging.dispatcher.DispatcherWrapperState.dispatchSync(DispatcherWrapperState.java:252)
         at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSync(DispatcherAdapter.java:43)
         at weblogic.jms.client.JMSConnection.stop(JMSConnection.java:758)
         - locked <0xffffffff7509a640> (a weblogic.jms.client.JMSConnection)
         at weblogic.jms.client.WLConnectionImpl.stop(WLConnectionImpl.java:722)
         at ConnectorSession.closeJMSSession(ConnectorSession.java:499)
         at ConnectorSession.receiveRequest(ConnectorSession.java:617)
         at ConnectorSession.processRequest(ConnectorSession.java:341)
         at Worker.mainApplication(Worker.java:127)
         at Worker.mainMethod(Worker.java:298)
         at Worker.main(Worker.java:163)
    "VM Thread" prio=3 tid=0x000000010039c800 nid=0x10 runnable
    "GC task thread#0 (ParallelGC)" prio=3 tid=0x000000010011b000 nid=0x3 runnable
    "GC task thread#1 (ParallelGC)" prio=3 tid=0x0000000100121000 nid=0x4 runnable
    "GC task thread#2 (ParallelGC)" prio=3 tid=0x0000000100122800 nid=0x5 runnable
    "GC task thread#3 (ParallelGC)" prio=3 tid=0x0000000100126000 nid=0x6 runnable
    "GC task thread#4 (ParallelGC)" prio=3 tid=0x0000000100127800 nid=0x7 runnable
    "GC task thread#5 (ParallelGC)" prio=3 tid=0x0000000100129000 nid=0x8 runnable
    "GC task thread#6 (ParallelGC)" prio=3 tid=0x000000010012b000 nid=0x9 runnable
    "GC task thread#7 (ParallelGC)" prio=3 tid=0x000000010012c800 nid=0xa runnable
    "GC task thread#8 (ParallelGC)" prio=3 tid=0x000000010012e000 nid=0xb runnable
    "GC task thread#9 (ParallelGC)" prio=3 tid=0x000000010012f800 nid=0xc runnable
    "GC task thread#10 (ParallelGC)" prio=3 tid=0x0000000100131800 nid=0xd runnable
    "GC task thread#11 (ParallelGC)" prio=3 tid=0x0000000100133000 nid=0xe runnable
    "GC task thread#12 (ParallelGC)" prio=3 tid=0x0000000100134800 nid=0xf runnable
    "VM Periodic Task Thread" prio=3 tid=0x00000001003d5800 nid=0x17 waiting on condition
    JNI global references: 818

  • Array Of Clusters Not Initializing or Possible Race Conditions

    Hi all,
    I've been working on a fairly complex project for work, and I haven't worked with Labview before. Unfortunately nobody in my office really has experience with it so I'm on my own. I've mostly got the project working, and it might be a little cumbersome, but if it works that's fine.
    Essentially it's a temperature control device and I made it so it's expandable, thus the clusters and arrays everywhere.
    My question is this. I've got an array of clusters indicating the status of all the plates in the system. When I start up the VI for the first time they do not initialize. They just stay grey, but when I stop it and start it once, it will work every time. I think this is kind of strange behavior. I've heard of race conditions and while I've tried to make sure t hat's not happening, it might be without me noticing.
    I've tried putting an initialize array block in the first call while loop and that doesn't do anything, and if I remove the initializer from the shift register in the top while loop that stops them being initalized altogether.
    I guess I was hoping someone might have an idea what's causing it, or could possible give my code the once over. The main bulk of it is in the very top of the code, but there are a lot of smaller events taking care of GUI type stuff.
    I've included all source code. It might be a little much but I didn't want to start pulling it apart if I don't know what's happening.
    Thanks in advance.
    Chris.
    Solved!
    Go to Solution.
    Attachments:
    Error During Cycle Controls.zip ‏3107 KB
    Stop Cycle Controls.zip ‏2115 KB
    Stop Cycle Controls.zip ‏4975 KB

    Chris Johnson wrote:
    So just to confirm, I can have one event structure with say 10 events happening? In this case could an event happen simultaneously with another? I thought I read something about each event having it's own event structure and while loop to make sure this works out.
    Each event case must complete before it can handle the next event, but many events will complete so quickly that this is not an issue (such as your "pause chart" button).  In general you should have only one event loop.  If you expect an event to take a long time to process, use a queue to hand that task off to another dedicated-purpose loop, so that the event structure can go back to waiting.  This is one example of the producer-consumer structure often mentioned on this forum: the producer is the loop containing the event structure, and it queues (produces) items to process.  A separate loop dequeues (consumes) those items and handles them appropriately.
    As GerdW mentioned, you have race conditions all over the place.  You'll never know whether the Plate Info Cluster Array is properly updated because it's being written and read simultaneously in so many places.  I'm assuming that is also where you're seeing the issue that inspired the post, and, in fact, one of those race conditions could explain what you're seeing.
    Chris Johnson wrote:
    Also, again, to confirm what I think I already know. When the event completes it outputs whatever data you output from the structure and then you can place it in a shift register. Where does this go until the next event takes place?
    I don't understand what you're asking.  Where does what go until the next event?  If by this you mean the data in the shift register - it stays in the shift register, accessible at the corresponding terminal on the left side of the loop.

  • Problems w/ race conditions when using attachmovie

    Hello,
       I'm having a strange problem w/ race conditions when using attachmovie.
    I have a class linked to a movie clip that I'm attaching to the stage.   The class is
    fired off when the movie clip is attached but also other classes are getting loaded at the same time
    while the movie clips is attached.     Even though the other classes are called after the
    movieclip is attached, they are getting loaded faster and therefor the class linked to the attached movie clip
    cannot access their functions. 
    I'm looking for a listener that will fire off an event ONLY when the attached movieclip is fully loaded but I can't
    seem to find any examples of associating a listener to a attachmovie method.
    Any ideas?
    Thanks,
    Clem C

    flash is single threaded so nothing happens simultaneously.  what do you mean by, "other classes are getting loaded at the same timewhile the movie clips is attached"

  • Forms 6 CPU racing (not race condition)

    Hello Everybody,
    I am having a strange problem that I was not able to find anything about in the other posings. Hoping somebody can point me to some helpful info or posings.
    Here is what is going on:
    I have Oracle 8i installed on an Intel P4 testing platform along with Forms 6.0.5. The machine is equiped with enough memory and power that Forms and Oracle 8i should be able to run without any trouble (I have run this setup fine on less powerful machines).
    When I then run a Forms application in the new setup the Forms application starts up normally and appears to be running perfectly.
    However when I look at the Windows Task Manager the Forms application turns out to be racing the processor at 100% of capacity. Even some little tiny forms application with only one Canvas and 2 blocks still causes the CPU to race at 100% capacity - even when I am not running a query! It just sits there and revs the CPU.
    Even stranger when I put the input focus onto any other program (NotePad for instance) the CPU cycles die back to zero again. But when I again put the focus (using ALT-TAB or something) back onto the Forms application the CPU starts revving up again.
    Note that this is NOT a "race condition" because I am still able to use the computer and even the Forms application itself. However it is NOT normal for a little tiny Forms module to be able to take up 100% of CPU cycles even when the module is not doing anything.
    Anybody have any ideas what the problem could be?
    Thanks for any help.
    Chris

    Chris,
    if it doesn't hang the computer as it indicates then maybe the task manager does not show what's really consumed by Forms. Ig Forms 6.0 is the cause then I suggest to upgrade to Forms 6i as this is tested and bug fixed with newer OS and processors.
    Frank

  • How to solve this race condition

    Hi there,
    the following code was taken from an official Java Tutorial at http://java.sun.com/docs/books/tutorial/essential/threads/synchronization.html but it's bugy 'cause it's creating race conditions I cannot handle.
    // this is the consumer
    // it tries to get the content of cubbyhole
    // but as soon as "available" becomes "false"
    // the content can change
    public synchronized int get() {
            while (available == false) {
                try {
                    wait();
                } catch (InterruptedException e) { }
            available = false; // <-- the producer can access the cubbyhole
            notifyAll(); // the producer is being notified (wake up)
            return contents;
        }Imagine the scheduler interrupts the consumer just after the "notifyAll()" method (race condition). The producer can access the cubbyhole (available = false) and store a new value in it. Due to the fact that the cubbyhole is a reference the "return contents" command in the consumer will now return the new (overwritten) value. This code definitely won't work. The only way it works is to clone (!) the current "contents" in a separate variable BEFORE awaking the producer and enabling it to make changes.
    I had serious troubles in using the wait() methods and like to know your oppinions/experiences about that.
    Thx for reading.
    90210

    I'm not going to bother looking at that tutorial, but I'd venture to guess that you are making a false assumption. Since get() is synchronized, no other thread can acquire a lock to the object being synchronized on while this method is changing the value of 'available' to false. But without seeing the context of what those other threads might be doing, it's hard to tell if you really have a valid claim or not (that it's 'buggy'). But 99.99999% of the time, its your own mistake/misinformation/invalid analysis.

Maybe you are looking for