I'm having problems in a GOOP applicatio​n with multiple instances of the same object running simultaneo​usly.

I?ve written an application to control a system with multiple lamps. Each lamp in the system has its own power supply. Each lamp object contains a reference to its power supply. The application contains an array with the references to all the lamps in the system. Each lamp is in charge of monitoring itself and setting its power supply?s voltage according to the applications commands, therefore each lamp needs that its ?run me? method will run as long as the application is running i.e. the run method has to be reentrant. Because there are multiple lamps and because the ?run me? methods for each lamp run simultaneously, to over come this problem each lamp has a met
hod ?run? that calls ?run me? with ?RUN VI? invoke node with the ?Wait until done? set to false. When I run the application, it seems to work but if I check the AO there is no change in the output, and the lamps seem to be reading their input from the same channel. I can?t seem to find the problem, I think that the fact that the method is reentrant causes some sort of mix-up in the separate object references. Also because the method is reentrant I can?t debug it (with one lamp it seems to work ok). Does anyone have any idea what could be causing this problem.
P.S I'm having problems attaching my sample program to this message. You can contact me at [email protected] to recive the sample program I wrote.

Jean, Thanks for your answer, I've tried checking the invoke node that calls the "Run VI" method but it doesnt return an error any of the times its called even that the Vi that it called is still running. I also tried your solution of changing the object's "Run" method to a template but that doesnt work either. I can't seem to post the sample progam that demonstrates the problem, is it possible to send it to you by email, contact me at [email protected]
Attachments:
Sample_program.zip ‏926 KB

Similar Messages

  • Problem:Multiple instances of the same applet on a webpage...

    I have an applet which connects to a server to read an XML-file.
    I use Doucument to parse the XML-file like this:
    String xmlurl="http://www.somesite.com/somexmlpage.php";
    Document d =DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(xmlurl);
    (...read the XML-file...)
    This works fine.
    However, I need multiple instances of the same applet running at the same time on the same webpage.
    Now, with multiple applets running at the same time the parsing no loger works. If one applet is doing some parsing and a taskswitch takes place to let another applet run, the applet which is interrupted is not able to continue the parsing as it looses its "incoming data" when another applet reads from the server.
    How can different applets affect each other like this?
    And how can I fix the problem?
    Thanks in advance for any help!!

    However, I need multiple instances of the same applet running at the same time on the same webpage.
    Why? But okay.Because the the different applets show information about different items.
    Now, with multiple applets running at the same time the parsing no loger works. If one applet is doing some parsing and a
    taskswitch takes place to let another applet run, the applet which is interrupted is not able to continue the
    parsing as it looses its "incoming data" when another applet reads from the server.
    How did you determine that's what's happening?By printing out debuginformation.
    Each applet prints out a message (System.out.println) when it creates an instance of Document (ie. connects to the server) and the applet also prints out XML-information as the XML-file is processed.
    But, actually, I was a bit quick in my first post; The applet doesen't neccesarily loose its "incoming data", but the parser looses the data it is parsing. I can download the data from the server first, and then start parsing it. If a taskswitch happens while one applet is parsing, it looses its data, even if the data is allready downloaded.
    I see this since I see another applet making a printout, and when first applet starts again, the parser has lost track of its data.
    It works fine if only one applet is running. And everything is fine until the next applets starts; I can see this from the printout.
    Again, the appet prints out data as it parses the document. I see the next applet starting to work, and when the first one continues parsing again the printout shows that data is no longer there. It happens everytime the runtime switches to another applet, and it never happens if just one applet is running.
    Googeling a little tells me that DocumentBuilder.parse() isn't thread-safe, but this shouldn't have anything to do with it, should it?
    Each applet is a separate process, and not different threads in the same process, aren't they? (Not sure how the runtime treats multiple applets...)And secondly, the applets create their own instance of Document anyways.

  • Problem with multiple .swf in the same page

    Hi everybody,
    I got a small animation written in actionscript 2.0. I need
    to load it several times in a webpage (about 20 instances), but
    seems to be too many work and the web browser freezes.
    Anyway, it's a relatively simple script (not complex
    arithmetics per cycle, although two or three color gradient
    refreshing), so I think the problem could be the fact of having so
    many instances running at the same time...
    Is there any way to fix this problem without reducing the
    quality of the animation?
    Thanks a lot!

    Sorry Kglad, I didn't mean to be rude. With "No coding
    errors" I meant the animation itself runs with no errors. I'm sure
    you could run the 20 instances with no freezing (that's why I put
    the post :) ) But I'm affraid it is an animation for a client, so I
    cannot distribute the code.
    Perhaps I didnt explain the situation clearly enough (in part
    because of my poor english...).-
    - By 20 instances I mean 20 separated embedded objects in the
    html
    - The animation is relatively simple. A turned on candle, in
    each cycle I calculate the next position of the flame (that
    oscilates from left to right). The flame is composed by 4
    concentric gradients. There is NO loops, only an 'onEnterFrame'
    function refreshing the flame each time.
    - It's true that I got plenty variables at the _root level.
    If that could be the problem, how can I workaround it?
    - It is my first time trying to embed so many objects at the
    same time too. No idea if the problem could be the way I embed the
    object from the html :(
    - The only thing I can guess is that when a cycle of one of
    the object is running, the other 19 objects must wait their turn.
    That would explain why the more instances I run, the worst results
    I get. In that case, I wonder if there's a way to run them in a
    kind of asynchronous mode, just guessing...
    Any other comment would be appreciated. Anyway, thanks a lot
    everybody for your colaboration.

  • Problems with multiple connections in the same transaction

    Hi all !
              I'm have two questions regarding the way weblogic handles multiple
              connections.
              1) first, I don't understand why weblogic always create a new Managed
              Connection when I'm asking for 2 connection handles on the same connection
              factory and with the same connectionRequestInfo. Isn't it supposed to share
              connections ?
              For instance, the following snippet of code results in the creation of 2
              managed connections:
              ConnHandle conn1 = myCF.getConnection(myRequInfo);
              ConnHandle conn2 = myCF.getConnection(myRequInfo);
              The class corresponding to myRequInfo does implement the equals and hash
              method, so that weblogic's connection manager could use them to check that
              the queried connections are the same, and thus could share a single
              ManagedConnection between multiple connection handles. Apparantly it does
              not do that...
              2) OK, I just let weblogic create the 2 managed connections, but... My use
              of the connections is as part of a transaction. Here is what happens:
              ConnHandle conn1 = myCF.getConnection(myRequInfo);
              // a new managedConn1 is instanciated. the following happens (just a
              description)
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS)
              // I use the conn1 handle
              conn1.close();
              //xar1.end(SUSPEND)
              ConnHandle conn2 = myCF.getConnection(myRequiInfo);
              // a new managed connection managedConn2 is instanciated.
              // xar2 = managedConn2.getXAResource();
              // xar2.start(RESUME)
              // I use conn2 handle
              conn2.close();
              // xar2.end(SUSPEND);
              // my bean returns from the remote invocation
              // the client of the bean asks to commit (using UerTransaction.commit on the
              client side)
              // xar2.end(SUCCESS)
              // xar2.commit(onePhase=true);
              // managedConn2.cleanup();
              And that's all. So, as one can see, managedConn1.cleanup was never called.
              When looking in the weblogic console, I can see that I have one connection
              with 0 handle and one with 1 handle, deemed as still being in a transaction.
              So, the conenction manager apparantly loses a managed connection during the
              transaction. And it's very very bad because after a couple of transactions,
              I'm running out of managed connections (I had set a limit of 10).
              Any one has seen such a weird behavior ? Is this a problem on my side, or
              weblogic's ? Thanks for your help.
              Sylvain
              

              I ran another test. This time I have a bean that makes use of a connector
              once per method invocation. The bean method invoked is "sayHello" and it
              gets a connection to the EIS, perform an operation on it and release it. The
              connector I developed uses XA transactions.
              My test client just calls 3 times myBean.sayHello().
              I can distinguish two cases:
              1) first, the client doesn't do transaction demarcation. In this case, since
              the sayHello method is marked as requiring transaction, the folowing happens
              in the bean:
              // **** first invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn1 is instanciated
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar1.end(SUCCESS);
              // the bean returns from its invocation
              // xar1.commit(onePhase=true)
              // managedConn1.cleanup()
              // **** second invocation of the bean
              connHandle = myCF.getConnection();
              // managedConnectionFactory.matchManagedConnection is called. It returns the
              managed connection (managedConn1) that is in the passed set
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close
              // xar1.end(SUCCESS);
              // the bean returns from its invocation
              // xar1.commit(onePhase=true)
              // managedConn1.cleanup()
              // **** third invocation of the bean
              connHandle = myCF.getConnection();
              // managedConnectionFactory.matchManagedConnection is called. It returns the
              managed connection (managedConn1) that is in the passed set
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close
              // xar1.end(SUCCESS);
              // the bean returns from its invocation
              // xar1.commit(onePhase=true)
              // managedConn1.cleanup()
              2) second case : the client performs transaction demarcation. In that case,
              the connection manager instanciates 3 managed connections, calls start/end
              on each XAResource corresponding to each managed connection, calls commit
              once, but also calls cleanup only once, leaving 2 lost managed connections
              The client looks like this:
              UserTransaction utx = context.lookup("javax/transaction/UserTransaction");
              utx.begin();
              MyBean myBean = ctx.lookup(".......");
              myBean.sayHello();
              myBean.sayHello();
              myBean.sayHello();
              utx.commit();
              on the server the following happens:
              // **** first invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn1 is instanciated
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar1.end(SUSPEND);
              // the bean returns from its invocation
              // **** second invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn2 is instanciated
              // xar2 = managedConn2.getXAResource()
              // xar1.isSameRM(xar2) is called. returns true
              // xar2.start(RESUME);
              // managedConn2.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar2.end(SUSPEND);
              // the bean returns from its invocation
              // **** third invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn3 is instanciated
              // xar3 = managedConn3.getXAResource()
              // xar2.isSameRM(xar3) is called. returns true
              // xar3.start(RESUME);
              // managedConn3.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar3.end(SUSPEND);
              // the bean returns from its invocation
              // the client invokes commit on the UserTransaction
              // xar3.end(SUCCESS);
              // xar3.commit(onephase = true);
              // managedConn3.cleanup();
              And so, managedConn1 and managedConn2 got lost in the way...
              What's more puzzling, it's that when monitoring my connector with the
              console, I can see that there are 3 connections. 2 declared as still having
              one handle used and being in transaction, and one not in transaction and
              with 0 active handle. BUT when monitoring the JTA part of the server, I can
              see that there has been 1 transaction that committed, and no connection is
              "in flight" as the console says. So, on one side the console says 2 managed
              connections are still part of a transaction while on the other it says that
              no transactions are currently in flight.
              Thanks for any kind of help on this very bizarre behavior.
              Sylvain
              

  • Problem with multiple threads accessing the same Image

    I'm trying to draw into one Image from multiple threads. It works fine for a while, but then suddenly, the image stops updating. Threads are still running but the image won't update. I'm using doublebuffering and threads are simply drawing counters into Image with different speed.
    It seems like the Image gets deadlocked or something. Anyone have any idea what's behind this behavior or perhaps better solution to do such thing.
    Any help will be appreciated.

    Sorry Kglad, I didn't mean to be rude. With "No coding
    errors" I meant the animation itself runs with no errors. I'm sure
    you could run the 20 instances with no freezing (that's why I put
    the post :) ) But I'm affraid it is an animation for a client, so I
    cannot distribute the code.
    Perhaps I didnt explain the situation clearly enough (in part
    because of my poor english...).-
    - By 20 instances I mean 20 separated embedded objects in the
    html
    - The animation is relatively simple. A turned on candle, in
    each cycle I calculate the next position of the flame (that
    oscilates from left to right). The flame is composed by 4
    concentric gradients. There is NO loops, only an 'onEnterFrame'
    function refreshing the flame each time.
    - It's true that I got plenty variables at the _root level.
    If that could be the problem, how can I workaround it?
    - It is my first time trying to embed so many objects at the
    same time too. No idea if the problem could be the way I embed the
    object from the html :(
    - The only thing I can guess is that when a cycle of one of
    the object is running, the other 19 objects must wait their turn.
    That would explain why the more instances I run, the worst results
    I get. In that case, I wonder if there's a way to run them in a
    kind of asynchronous mode, just guessing...
    Any other comment would be appreciated. Anyway, thanks a lot
    everybody for your colaboration.

  • Multiple instances of the same applet loaded causes problem

    I have a java applet that has several classes in the project. The applet has a JTable a JButton and a JLabel control. The applet is displayed within an HTML page. The problem is that if a user opens the same html page more than once with the applet in it, only the last applet loaded receives the screen updates.
    For example in one senario. I have an error message that displays in the Label control once they click on the button.
    The user opens the html page and the applet is loaded (window 1). The user then opens the same html page again (window 2) with window 1 still open. If the user clicks on the Button in window 1, the error message is displayed in the window 2 applet.
    Originally I had some static variables. Thinking it was being used globally by the JVM so I removed all of them and it still happens. I have tried using both the Applet and Object tag. But it still happens.
    Has anyone experienced this before? Any suggestions on how to make the applet update the instance that recieved the events and not just the last one that was loaded?

    You need to look at applet classloader issues. If applets have the same archive list and come from the same codebase, they have the same classloader. A class is namespaced by it's class + classloader. Any statics in a class with a classloader will be shared. If you instead make it such that your applets have unique classloaders (which you can't change for unsigned applets by yourself) by changing the codebase, that would be one solution.
    For other solutions, I recommend searching the forum. This issue comes up a lot.

  • Problem with Multiple Versions of the Same Activex

    Hi,
    I Installed some "ABC" Activex 9.5 version and 10.1 version in the system.
    I have ASP.net webpage which should use only 9.5 version of Activex.  But by default 10.1 version is active and invoking by webpage.
    Is there any way to enforce from webpage to use only 9.5 version of Activex?
    Please let me know if you need more details.
    Thanks & Regards,

    Hi,
    Have you tried to uninstall this Activex in Manage add-on, then install the 9.5 version? Please have a try.
    Roger Lu
    TechNet Community Support

  • HT201263 hello guyz i m having problem while restoring my iphone 4.It is showing me the 1600 error before that it showed 3194 error i fixed that after that it showed me the error 1601 also i fixed it but now with 1600 plz plz help me guyz

    hello guyz i m having problem while restoring my iphone 4.It is showing me the 1600 error before that it showed 3194 error i fixed that after that it showed me the error 1601 also i fixed it but now with 1600 more then 20 times tried but no advantage plz guyz help me?

    iTunes: Specific update-and-restore error messages and advanced troubleshooting - http://support.apple.com/kb/TS3694 - relating to iPad, iPhone, iPod touch, iTunes

  • I am having problems shutting down my MacBook Pro.  I go to the apple and click shutdown or restart, it appears the shutdown process starts, the screen goes blue and the little circle keeps going round and round, but nothing happens even after 30 minutes.

    I am having problems shutting down my MacBook Pro.  I go to the apple and click shutdown or restart, it appears the shutdown process starts, the screen goes blue and the little circle keeps going round and round, but nothing happens even after 30 minutes.

    Make sure you quit all your applications before shutting down.
    And try resetting the SMC.
    Intel-based Macs: Resetting the System Management Controller (SMC)

  • I am having problems streaming movies to my ipad from my mac. The movie starts and then pauses and then starts again. any ideas?

    I am having challenges streaming movies from my Mac Mini to my IPAD 3, the movie will load (after what seems a bit too long) and start to play. It then stops after 30-50 seconds and if I leave will start again, but repeat the start stop thing. Its almost like it stops to buffer than starts again. I have had the same issue appear wiht my Iphone 5.
    Thoughts?

    Welcome to the Apple Community.
    Intermittent problems are often a result of interference. Interference can be caused by other networks in the neighbourhood or from household electrical items.
    You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate.
    There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software. You might also try moving the Apple TV away from other electrical equipment.

  • Having problem sending e-mails.  There's a message on the screen saying that "the sender address was rejected by a server.

    I'm having problem sending e-mails.  There's a message on the screen after I press send saying that "The sender adress was rejected by a server.

    Check the outgoing mail server setting. Make sure that your username and password are in there.
    Settings>Mail, Contacts, Calendars>Your email account>Account>Outgoing mail server - tap the server name next to SMTP and check in the primary server and make sure your username and password are entered and correct - even if it says that the password is optional.

  • I am having problems downloading ios 5 update as it gets right to the end it then says my internet has timed out, even though it hasnt .  Any ideas?

    I am having problems downloading ios 5 update as it gets right to the end it then says my internet has timed out, even though it hasnt .  Any ideas?

    This is a common issue and a solution could have been quickly found by doing a search.
    Disable any Anti-Virus and Firewall software on the computer, then run the update.

  • I'm also having a music issue.  When my phone is attached to the computer (mac running 10.6.8) it looks like my music is there but its gray and I can't play anything.  I've tried to delete it and it won't let me but it does not show up on my phone.

    I'm also having a music issue.  When my phone is attached to the computer (mac running 10.6.8) it looks like my music is there but its gray and I can't play anything.  I've tried to delete it and it won't let me but it does not show up on my phone.

    By the way, I have tried shutting of the display switching in the power settings.  That was basically the only real answer I found anywhere.  It didn't work.

  • I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    I am having trouble getting a numbers spreadsheet to hold different formats in the same column.  A column with a date formatted heading will not convert to $ for the cells below.   Any suggestions would help.

    Hi Wayne,
    Thank you for this response.  I have tried this but when I start enterring $ amounts some, such as $6.00, go in OK others such as $4.00 appear as a date ie 4 Oct 12.  
    Kind regards
    Paul

  • I have problem with my iphone 5 the battery still running so fast

    i have problem with my iphone 5 the battery still running so fast

    Click the link below choose your country then choose service and see if you have an Apple Authorised Service Provider in your country.
    https://locate.apple.com/au/en/
    If you dont have any Apple Authorised Service Providers near you either then contact AppleCare and ask them for options for postage in your country/region. You can find the number for your country below:
    http://support.apple.com/kb/HE57
    Hope this helps

Maybe you are looking for