Another halting Thread problem

Hello,
I want to make a benchmark software using Java, and I want to add capability to stop the test if such setting was selected that the test would take forever. I know that I can do this with using such code like:
public class MyBenchThread extends Thread {
boolean toldToStop = false;
public void run() {
  while (!benchmarkEndConditionHasMet && !toldToStop) {
   // Run heavy benchmark here
public void haltTest() {
  toldToStop = true;
}and calling haltTest() from another Thread.
However, this has two problems:
1) To have the benchmark at its purest level, I would like
to avoid extra computation as much as possible. Is there a way to give the same effect of killing the thread without constantly checking a condition variable?
2) If the benchmark involved some I/O operation (not necessarily over a socket to which you can set a timeout) that takes a while to complete, I would not be able to halt it using the above code or interrupt() function in Thread class. I know that stop() is likely to cause problem... So is there any way to force interrupt execution of the Thread including I/O, do whatever cleanup is needed, and gracefully exit?
Thanks in advance

Sorry for late response... Had been away for weekend.
Well, interrupt() does not seem to work on I/O operation. It only works on a Thread that is actually sleeping or waiting on a monitor. If it was doing some heavy number crunching or I/O, I think it will only set its interrupted status to true, and does not actually suspend its operation. (This is my assumption; correct me if I am wrong)
Hmm... so I guess there is not really a way to get around this. I was having problem with using a proprietary library that established a CORBA session inside it, and it did not provide any way of halting the operation externally. Unless I Ctrl-C whole VM, the library call just kept on going for about 30 secs till it finally gave up.
I don't know... Is force trying to stop a problematic thread that dangerous thing in general to do in multiprocess programming, even if you knew what you were doing?

Similar Messages

  • Cant syncronize! Threads problem

    Hello everybody,
    recently i posted a question(im new to threads) and it was asked immediately but now i have another
    type of problem.
    Please read here the initial post and the answer and please give me any ideas..
    Initial Post
    Hi everybody,i have this thread problem(i'm new to java and h
    ave no idea what exactly to do).
    Well,in my applet i have this action performed method
    that i imagine is in the event dispatch thread.
    This method calls as u see, two other methods of a class named CPU(.
    Note that fetch and execute are observed classes and my applet class
    is the observer.
    The problem is that during the execution of fetch() and execute(),
    inside these methods change some things and so they call notifyObservers(Object arg)
    passing to the applet the argument and so the applet updates some text components.
    But as you can immagine there is no time for the gui to update himself so i see nothing.
    So, my question is which of the methods need to be in a separate thread so to ensure
    visible results(component updating)?
    Perhaps,the update method needs to be invokedLater with SwingUtilities?
    Please give me an example code if possible.
    Here is the actionPerformed code(from the applet class) and the fetch method:
        void executeProgramButton_actionPerformed(ActionEvent e) {      
    int numInstr = this.machine.ram.segmentSize;       
    for (int i = 0; i < numInstr; i = i + 4) {           
    machine.cpu.fetch();           
    machine.cpu.execute();       
    /*The following method is in the CPU class
    fetch method:here the observedPC is the observable value
    that notifies the observer(the main applet)
    that does: pcTextField.setText(arg.toString());*/   
    public void fetchInstructionProgram() {       
    observedPC = Integer.toString(pc);       
    setChanged();       
    notifyObservers(observedPC);       
    instructions++;       
    instruction=readOperation(cache.instructionfetch,pc);       
    pc = pc + 4;    }
    Answer to initial post
    Author: stevejluke
    One way could be to put the content of the action performed method into a new thread, then use invokeLater in your Observers that cause GUI updates:
        void executeProgramButton_actionPerformed(ActionEvent e) {     
    new Thread()       {      
    public void run()        {         
    int numInstr = this.machine.ram.segmentSize;         
    for (int i = 0; i < numInstr; i = i + 4)           {           
    machine.cpu.fetch();           
    machine.cpu.execute();         
    }.start();    }
    // In your Observer    public void update(Observable o, Object arg)    {     
    SwingUtilities.invokeLater(new Runnable() {      
    public void run()        { 
    /* your GUI afecting code
    });[i]
    Or something like that.
    You might need to watch for synchronizing things
    He was right...GUI is responsive but the results...
    Well,let me describe the new problem.
    Here you cant see the method execute().
    The problem is a synchronization problem.
    Actually,what the two methods do is:fetch() updates the value of a long called instruction and execute() takes this value and do some things.Note also that the time the execute method needs to finish is not
    always the same.By that, i mean that it depends on the value of the instruction updated by fetch().
    By putting some System.outs before and after updating i realized that there are delays or sometimes
    i noticed that fetch() executes 2 times before execute() takes control.
    So,i created some synchronized private methods set and get to control access to these resources.
    Better but still not correct...
    What should i look?Where stays the answer?
    How to synchronize these two methods on these resources?
    Thank you in advance,
    Chris

    I think that your fetch and execute has a "Producer-Consumer Relationship"
    in such cases you can make the producer place the produced value in to a queue and consumer take the vlues from the queue
    In the producer thread it sleeps for a while and try again if the Queue is full
    In the Consumer thread it sleeps for a while if the Queue is empty and then try again
    Or you can do as follows
    In the Producer thread it waite() if the Queue is full
    In the Consumer thread it waite() if the queue is empty
    When ever Producer put a value in to the Queue it calls the notify on Consumer and when ever Consumer takes a value from Queue it calls the notify() on Producer
    you can even use notify all
    I think thiere is no built in Queue class in java so you will have to write one here is a example
    public class MyLongQueue{
                long data[];
                int head, tail;
                int size;
               public MyLongQueue(int size){
                    data = new long[size];
                    head = -1;
                    tail = -1;
                    this.size = 0;
                public synchronized boolean isFull(){
                    return (size==data.length);
                public synchronized boolean isEmpty(){
                    return (size==0);
                public synchronized boolean  insert(long l){
                    if (size==data.length) return false; //Queue is full cant add more data
                    tail = (tail + 1) % data.length;
                    data[tail] = l;
                     size++;
                    return true;
               public synchronized long remove(){
                   if (size==0) throw new ArrayIndexOutOfBoundsException();
                   size--;
                   head = (head + 1) % data.length;
                   return data[head];

  • Another process (thread) is applying transactions for this client:

    Has anyone seen this error
    'Another process (thread) is applying transactions for this client: MNEWMAN Try again later.'
    We seem to be getting a few upload transactions put into the error queue for this reason, sometimes just executing the transaction clears it, but more often the data actually looks to have been correctly posted to the server as well as appearing in the error queue, as itf two threads have picked up the same transaction, one has applied it without error and the other failed
    any ideas?

    latest update from Oracle is to
    1.Set MAX_APPLY_TRIES=5
    2.Set APPLY_TRIES_DELAY=10
    Done this, but waiting for sufficient activity to see if it solves the problem.
    I had thought about knocking max_threads down to 1 (and might do this to try and isolate some odd performance issues), but the problem is that this would make the apply and compose process take three times as long (we use 3 threads), and that will not be acceptable for long on the live system

  • HANDLER THREAD PROBLEM?

    I'm trying to use the method Response.sendRedirect to forward users to another website. The actual case is irrelevant so I've extracted the important part into a simple servlet example:
    import javax.servlet.http.*;
    import java.io.*;
    public class ReDirect extends HttpServlet
       public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException
          if(req.getQueryString()!=null)
             res.setContentType("text/html");
             res.getWriter().println("Your querystring: <b>"+req.getQueryString());
          else
             res.sendRedirect("http://java.sun.com");
    }The funny thing is that the servlet works FINE, but that darn thing is generating an IOException (showing in the DOS prompt of the webserver) everytime the sendRedirect method is called! Why?
    ReDirect: init
    HANDLER THREAD PROBLEM: java.io.IOException: Socket Closed
    java.io.IOException: Socket Closed
         at java.net.PlainSocketImpl.getInputStream(PlainSocketImpl.java:432)
         at java.net.Socket$1.run(Socket.java:335)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.Socket.getInputStream(Socket.java:332)
         at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)I have tried everything... I've also searched the forum for similar problems, but it seems that noone have a logic explanation for this. Is this a bug in the servlet engine or is it something I'm doing wrong or have forgotten?
    I'm using jswdk 1.0.1 and jdk1.3.1 on windows 2000, running the webserver that comes with jswdk.
    Please, someone, explain this to me! This problem is torturing me day and night!!
    /Stefan Westling

    Go get tomcat ...I used to get this error lot's when I used the jswdk. There are just some things it doesn't like ...yet when structured in certain way's ...it would work. I never did track down any consistent explanation. I just moved on to tomcat. The jswdk is really cheesy ...it can't do post ...or sessions ...or any 2.0 functionality ... or ... or ... Go get tomcat.

  • Mail crash?? - another Gmail IMAP problem...

    Hi,
    This problem seems similar to another recent thread but my Mail app is acting so strangely I think this warrants its own spot.
    I have been running Mail up till today with two accounts - a Gmail POP account and a college email ('BlitzMail', for any Dartmouth alums) IMAP account. I had a couple plugins installed - Mail Badger and Mail Act-On.
    Today, I decided to switch my Gmail account to IMAP. After I made the switch, everything seemed to be working fine. However, as soon as I clicked send on a test message from my Gmail account to see if I had set everything up correctly, Mail hung for a bit and finally just froze.
    After the force quit and restart of the computer, here is what has happened: Mail Act-On has entirely disappeared. It just doesn't appear anymore on the preference pane. Mail Badger is still on the preference pane, although all of the badges that I had previously had have disappeared. Also, I am not able to send any messages with either account. And, both accounts have been very slow and cranky - whenever I click on the Inbox, it takes several seconds to display the messages, and oftentimes displays several copies of them.
    Weirdest of all, however, is that I am not able to quit the Mail app. Apple+q simply doesn't work and the only way I can close the app is via a force quit. Finally, for some reason, the actual Mail window has stopped appearing by default and clicking on the dock icon doesn't bring it back. The only way I am able to view the actual window is by clicking View--> Message Viewer.
    Any help or suggestions? I use both accounts rather frequently and would like to get this sorted out as quickly as possible.
    Thanks a bunch!
    (And wow, this totally makes me envious of Time Machine!)

    for me, mail badger was the culprit. i e-mailed the developer and have not heard back.
    right after switching to gmail imap, i too was having the same problems as the original poster: could not properly quit mail; had to force-quit mail; when mail started the message window was not visible; always had to go to window-->message viewer to get it to appear; and on top of all that, mail badger didn't even work.
    got rid of it and all was fine. running httpmail, growlmail, mail act-on, mail followup, and largely no problems.
    but i think people are also right in saying that apple mail is finicky about gigantic imap accounts...which is why i keep almost all my gmail messages in the "all mail" folder instead of the inbox. something tells me the inbox loads faster that way?

  • Sun Java System Web Server 6.1 SP3 service-j2ee threads problem

    Hi,
    Sorry my english.
    I'm an intermediate Java programmer and a newbie in
    the Sun's web servers world.
    I'm doing an evaluation of an web applicaction
    written in Java Servlets that is
    supposed to have a leaking threads problem. We use
    SunOS 5.9 (... sun4u sparc SUNW,UltraAX-i2) and
    JVM 1.5 Update 4 (the problem is presented too
    in SunOS 5.8 and JVM 1.4.2_04).
    We have seen, thanks to 'prstat' (PROCESS/NLWP) a
    increasing thread's growing in one of the process
    that correspond to our web server instance (I'm sure I'm
    looking the right process). I have checkout the source
    code and it seems like the app doesn't have threads
    problems. I have used the Netbeans Profiler and I see a
    high number of threads called service-j2ee-x that grows
    in congestion moments and never disappear.
    Anybody could help me with suggestions?
    Thank you very much.

    Elvin,
    Thankyou, yes I am unfamiliar with debugging Java apps. I got the web server Java stack trace and I have passed this on to the developer.
    The web server finally closes the socket connection after the total connections queued exceeds 4096.
    There are several hundred entries like this... waiting for monitor entry.. could be a deadlock somewhere?
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "service-j2ee-506" prio=5 tid=0x04b62a08 nid=0x17a waiting for monitor entry [dd74e000..dd74f770]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.verity.search.util.JSDispenser.getConnResource(Unknown Source)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: - waiting to lock <0xe979b2b0> (a com.verity.search.util.JSDispenser)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.verity.search.DocRead.getDoc(Unknown Source)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.verity.search.DocRead.getDoc(Unknown Source)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.verity.search.DocRead.docViewIntern(Unknown Source)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.verity.search.DocRead.docView(Unknown Source)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at au.com.relevance.viewDoc.PdfXmlServlet.performRequest(PdfXmlServlet.java:120)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at au.com.relevance.viewDoc.PdfXmlServlet.doGet(PdfXmlServlet.java:141)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:787)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:322)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:212)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:161)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at com.iplanet.ias.web.WebContainer.service(WebContainer.java:580)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "StandardManager[highlight]" daemon prio=5 tid=0x000f3530 nid=0x1e waiting on condition [e15ff000..e15ffc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.sleep(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.threadSleep(StandardManager.java:800)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.run(StandardManager.java:859)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "WebappLoader[highlight]" daemon prio=5 tid=0x000f3328 nid=0x1d waiting on condition [e16ff000..e16ffc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.sleep(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.loader.WebappLoader.threadSleep(WebappLoader.java:1214)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.loader.WebappLoader.run(WebappLoader.java:1341)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "StandardManager[]" daemon prio=5 tid=0x000f2b08 nid=0x1c waiting on condition [e1b7f000..e1b7fc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.sleep(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.threadSleep(StandardManager.java:800)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.run(StandardManager.java:859)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "WebappLoader[]" daemon prio=5 tid=0x000f2900 nid=0x1b waiting on condition [e1c7f000..e1c7fc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.sleep(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.loader.WebappLoader.threadSleep(WebappLoader.java:1214)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.loader.WebappLoader.run(WebappLoader.java:1341)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "StandardManager[sitesearch]" daemon prio=5 tid=0x000f1cd0 nid=0x1a waiting on condition [e23ff000..e23ffc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.sleep(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.threadSleep(StandardManager.java:800)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.run(StandardManager.java:859)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "WebappLoader[sitesearch]" daemon prio=5 tid=0x000f1ac8 nid=0x19 waiting on condition [e24ff000..e24ffc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.sleep(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.loader.WebappLoader.threadSleep(WebappLoader.java:1214)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.loader.WebappLoader.run(WebappLoader.java:1341)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "StandardManager[search]" daemon prio=5 tid=0x000f0a88 nid=0x18 waiting on condition [e317f000..e317fc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.sleep(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.threadSleep(StandardManager.java:800)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at org.apache.catalina.session.StandardManager.run(StandardManager.java:859)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Thread.run(Thread.java:534)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "Signal Dispatcher" daemon prio=10 tid=0x000ef840 nid=0x12 waiting on condition [0..0]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "Finalizer" daemon prio=8 tid=0x000ef638 nid=0x10 in Object.wait() [fa27f000..fa27fc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Object.wait(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: - waiting on <0xe917fb10> (a java.lang.ref.ReferenceQueue$Lock)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:111)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: - locked <0xe917fb10> (a java.lang.ref.ReferenceQueue$Lock)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:127)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "Reference Handler" daemon prio=10 tid=0x000ef430 nid=0xf in Object.wait() [fa37f000..fa37fc28]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Object.wait(Native Method)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: - waiting on <0xe917fb78> (a java.lang.ref.Reference$Lock)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.Object.wait(Object.java:429)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:115)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: - locked <0xe917fb78> (a java.lang.ref.Reference$Lock)
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "main" prio=5 tid=0x000ee3f0 nid=0x1 runnable [0..ffbff200]
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "VM Thread" prio=5 tid=0x004ee328 nid=0xe runnable
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "VM Periodic Task Thread" prio=10 tid=0x004ee5d0 nid=0x16 waiting on condition
    [15/May/2006:22:01:51] warning ( 3196): CORE3283: stderr: "Suspend Checker Thread" prio=10 tid=0x004ee548 nid=0x11 runnable
    [15/May/2006:22:15:10] failure ( 3196): HTTP3287: connection limit (4096) exceeded, closing socket

  • Yes another user with problem with Apple Mobile Device Support, I am getting the error message: Service 'Apple Mobile Device'(Apple Mobile Device) failed to start. Vertify that you have sufficient privileges to start system service....

    Yes another user with problem with Apple Mobile Device Support, I am getting the error message: Service 'Apple Mobile Device'(Apple Mobile Device) failed to start. Vertify that you have sufficient privileges to start system service....I hit retry and it came up again. I hit ignore and it prompted me to hit finish so Itunes can open.   I looked thru alot of these posts on here to try and resolve this problem myself but it's not working too well...I downloaded Itunes to my desktop so I can right click it with the program i downloaded called WinRAR. I extracted it and then went into the folder called Itunes64setup. I saw the file called AppleMobileDeviceSupport64 in there so I began to try and download it on it's own. Well that didn't work as I planned and got this error message:
    Apple Mobile Device Support wasn't installed on your computer. The installer encountered errors before Apple Mobile Device Support could be configured. Your system has not been modified. To retry these operations at a later time,please run the installer again.
    Well I tried to run it again and came up with the same message...I see that some people got great support to help them so I am hoping someone can help me as well. I know "b nor" is very qualfied and hopefully can help me! Please advise what I can do. Thank you

    Hi Iss9243,
    Welcome to the Support Communities!
    You've already tried some great troubleshooting steps, but the article below gives you quite a few more for this issue.  Hope it helps ....
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Cheers,
    - Judy

  • JNI & thread problem

    Folks,
    I am using JNI to access WIA (Windows Image Acquisition) functionality under MS Windows XP. WIA consists of a bunch of COM interfaces. I have several native functions in a single dll, with a limited number of static variables stored in the dll between calls. This all works fine as long as long as the calls occur from the same java thread, but not if a new thread is created for some of the calls. I.e., this works:
    final WIACtrl ctrler=new WIACtrl();
    ctrler.initializeWIA();
    ctrler.transferJPGNative("0001\\Root\\IMG_0087","c:\\test.jpg");
    but this does not:
    final WIACtrl ctrler=new WIACtrl();
    ctrler.initializeWIA();
    (new Thread() {
    public void run() {               
    ctrler.transferJPGNative("0001\\Root\\IMG_0087","c:\\test.jpg");
    }).start();
    Here, initializeWIA() and transferJPGNative() are the native methods. What happens in the second case is that transferJPGNative fails in one of the COM methods (not the first COM method it calls). The COM method returns an HRESULT indicating an error (509) which I can't find using any of the usual MS error look-up mechanisms. (Admittedly I am not the world's greatest Windows programmer...)
    Anyway, any suggestions would be much appreciated. I have found some issues regarding JNI and threads in this forum's archives, but none of them seem to apply to quite this situation.

    As a guess this is just a windows threading problem.
    And with COM you have to do things differently (I believe) if there is more than one thread. You might not even be allowed to do it with for that particular API.
    It could also be that you are initializing things more than once. Or you need to initialize twice (two handles.)
    At any rate you could always fix it by making the java code only allow calls for a single thread.

  • Thread problem in swings

    I have made an application in swings i have stored the class files in a system and call that class files by a batfile shortcut in two diff. pcs .and i am tring to get an value of a Jtextarea in an event When I tried to run this application at the same time from 2 diff PCS,with diff string input in text area It is giving me the same vlaue.
    Tell me Y it is so.and how can i rectify it
    javauser

    Very strange... what makes you think that this is a threading problem?

  • Urgent!!!!!!!HANDLER THREAD PROBLEM

    file name GetName.html
    <html>
    <body>
    <FORM METHOD = POST ACTION = "SaveName.jsp">
    what is your name?
    <INPUT TYPE = TEXT NAME=username SIZE= 20>
    <p><INPUT TYPE= SUBMIT>
    </FORM>
    </BODY>
    </HTML>
    file name SaveName.jsp
    <%
    String name = request.getParameter( "username" );
    session.setAttribute( "theName", name );
    %>
    <HTML>
    <BODY>
    Continue
    </BODY>
    </HTML>
    file name NextPage.jsp
    <html>
    <body>
    Hello, <%=session.getAttribute("theName") %>
    </body>
    </html>
    when I try to execute , SaveName.jsp is generating the following error message. what is the problem? I am using jswdk. please help. I have included tools.jar in classpath. what could be the problem?
    Unhandled error! You might want to consider having an error page to report such
    errors more gracefully
    com.sun.jsp.JspException: Compilation failed:Note: sun.tools.javac.Main has been
    deprecated.
    work\%3A8080%2Fexamples\SaveName_jsp_1.java:71: Method setAttribute(java.lang.St
    ring, java.lang.String) not found in interface javax.servlet.http.HttpSession.
    session.setAttribute( "theName", name );
    ^
    1 error, 1 warning
    at com.sun.jsp.compiler.Main.compile(Main.java:347)
    at com.sun.jsp.runtime.JspLoader.loadJSP(JspLoader.java:135)
    at com.sun.jsp.runtime.JspServlet$JspServletWrapper.loadIfNecessary(JspS
    ervlet.java:77)
    at com.sun.jsp.runtime.JspServlet$JspServletWrapper.service(JspServlet.j
    ava:87)
    at com.sun.jsp.runtime.JspServlet.serviceJspFile(JspServlet.java:218)
    at com.sun.jsp.runtime.JspServlet.service(JspServlet.java:294)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:840)
    at com.sun.web.core.ServletWrapper.handleRequest(ServletWrapper.java:155
    at com.sun.web.core.Context.handleRequest(Context.java:414)
    at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:139)
    HANDLER THREAD PROBLEM: java.net.SocketException: Socket is closed
    java.net.SocketException: Socket is closed
    at java.net.Socket.getInputStream(Socket.java:643)
    at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)

    Are you using JSWDK 1.0.1? If you are, then the implementation uses the Servlet Spec. 2.1. The set/getAttribute methods were added in 2.2.
    Try using the now-deprecated method putValue like this in SaveName.jsp.
    <%
    String name = request.getParameter( "username" );
    session.putValue( "theName", name );
    %>

  • Thread problems with Samsung D500? Http or https troubles?

    Hi!
    I've got some troubles with my application installed onto my D500, and I suspect that's maybe thread problem.
    Does anyone know something about thread problems for this phone?
    I want to know, is there any trouble for connecting application by using http or https?
    I've found one problem for E720 - it escapes "backslash" character when it's used as http parameter.
    It makes parsing troubles...
    Did anyone have some similer troubles, and how have you solved this problem?
    Thanks in advance,
    Alex

    When I'm trying to connect to the net by using my application, I get two errors: "TCP open" and "interruptedIOException", and so I suspect that's some kind of thread problems.
    On the other phones (Nokia, Sony Ericsson) this application works with no problems...

  • Re: another forum thread

    == Issue
    ==
    I have another kind of problem with Firefox
    == Description
    ==
    Re: https://support.mozilla.com/en-US/forum/1/732746?hash=a0ca17d0ebc4007144af9581263a79ae#form
    Do I have to start it all the time in Safe Mode?
    == This happened
    ==
    Every time Firefox opened
    == When I installed it.
    ==
    == Troubleshooting information
    ==
    That solved my problem, but if I have to start Firefox in Safe-Mode all the time, I might as well go back to IE.
    == Firefox version
    ==
    3.6.7
    == Operating system
    ==
    Windows XP
    == User Agent
    ==
    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.7) Gecko/20100713 Firefox/3.6.7 ( .NET CLR 3.5.30729)
    == Plugins installed
    ==
    *-Office Plugin for Netscape Navigator
    *The QuickTime Plugin allows you to view a wide variety of multimedia content in Web pages. For more information, visit the QuickTime Web site.
    *NPRuntime Script Plug-in Library for Java(TM) Deploy
    *Adobe PDF Plug-In For Firefox and Netscape "9.3.3"
    *Default Plug-in
    *Shockwave Flash 10.1 r53
    *GEPlugin
    *Motive Plugin for Mozilla Browsers
    *Google Update
    *Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    *DRM Netscape Network Object
    *Npdsplay dll
    *DRM Store Netscape Plugin

    That wasn't a solution, it was a diagnosis step. The next step is to find the culprit extension causing the problem by disabling them all (from '''Tools -> Add-ons, "Extensions" section''') and restarting normally, then enabling each one by one, restarting Firefox and checking each time till you find the cause.

  • Another Airport Express problem thread.

    Hi Everyone,
    I got a Powerbook recently and like many on these threads I am beset with Airport Express problems.
    Here's my story. I purchased my Powerbook about a month ago and popped into the Apple Store to ask about the best way to have wireless internet access at home. They recommended the D-Link DSL-300T ADSL modem and Airport Express. I purchased these items and set everything up at home. This didn't work. After a week of talking to Apple, I got the answer to my problem from a Mac message board. Supposedly the ADSL modem recommended by Apple and stocked in their online store wasn't compatible with the lastest version of Airport Express 6.2.0. So I dowgraded the firmware to 6.1.1 and everything worked fine. My next problem was after running an OS X software update which I can presume also updated the Airport Express back to 6.2.0. So again I downgrade to 6.1.1 and it works again. Then I have to get my Powerbook replaced as the refurb Apple sold me didn't have the superdrive in it that Apple advertised, so I transfer my settings and files and i can go online for a couple of days and then it stops working again. I do the downgrade again but this doesn't help. So I take it to see a genius at Apple who performs the AE update 2005-001 which he says will solve the problem of incompatability with 3rd party modems. Take it home, it doesn't work. Powerbook almost gets thrown out of the window.
    Why is something that should be so simple so difficult.
    My questions are does anyone have a D-Link DSL 300T modem that works with the update 2005-001 ???
    Why do Apple recommend an ADSL modem which doesn't work with their products ???
    What ADSL modem for the UK does work with Airport Express ???

    Hi Bollard, not sure whether this would work with the current model of the modem, but I ran into problems with the DSL300+ when first using it wit an airport extreme, back in 2003.
    I eventually resolved the problems by using the modem in bridging mode. Not sure if this would be applicable with the new model, or whether it work if you are needing PPPoA rather than PPPoE, but for what its worth my experiences and solution can be found at http://discussions.apple.com/thread.jspa?messageID=607296&#607296 I've had a fair bit of positive feedback from people who found it worked for them, at least with similar equipment and connection protocol.
    Cheers
    Rod

  • SB Extigy (yup, another new thread for the same old problem!)

    = is the Extigy compatable with Windows 7?
    I have a little experiance with windows 7 now, and I have used the XP mode a few times.
    If it does work, would you need to be in XP mode, or would it work straight from 7?
    I only ask this because XP mode takes up a bit of processor power that would be better used for gaming/porn.
    Many thanks
    Dudemeister88

    Hi,
    As this thread has been quiet for a while, we assume that the issue has been resolved. At this time, we will mark it as ‘Answered’ as the previous steps
    should be helpful for many similar scenarios. If the issue still persists, please feel free to reply this post directly so we will be notified to follow it up. You can also choose to unmark the answer as you wish.
    BTW, we’d love to hear your feedback about the solution. By sharing your experience you can help other community members facing similar problems. Thanks for
    your understanding and efforts.
    Alex Zhao
    TechNet
    Subscriber Support in forum.
    If you have any feedback on our support, please contact
    [email protected]
    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

  • Another thread problem

    in the below code, a thread is created which waits for new clients to connect, then giving them a thread of which to communicate with the server. Now, instead of say creating 2 threads for 2 clients, everytime a message is sent a new thread is created. Any ideas on how to stop this?
    class ClientWorker implements Runnable {
      Socket client;
         ServerSocket server = null;
         ClientWorker(Socket client) {
       this.client = client;
    public void whiletruemethod() {
    while(true){
          ClientWorker w;
          try{
            w = new ClientWorker(server.accept());
            t = new Thread(w);
            t.start();
          } catch (IOException e) {
            System.out.println("Accept failed: 4444");
            System.exit(-1);
    public void threadtmethod() {
    BufferedReader in = null;
    PrintWriter out = null;
        try{
          in = new BufferedReader(new InputStreamReader(client.getInputStream()));
          out = new PrintWriter(client.getOutputStream(), true);
        } catch (IOException e) {
          System.out.println("in or out failed");
          System.exit(-1);
              dontgo = "2";
              String line;
        while(true){
              System.out.println("RUN");
                try{
            line = in.readLine();
                        if(line != null) {
                        //Send data back to client
             out.println(line);
                             messlistArea.append("BLAH " + line + "\n");
           } catch (IOException e) {
             System.out.println("Read failed");
             System.exit(-1);
                                       try { Thread.sleep(2000); }
                   catch(InterruptedException e) {}
      public void run(){
         if (t.equals(Thread.currentThread()) )
                   System.out.println("Running t Thread");
                   threadtmethod();
      if (whiletrue.equals(Thread.currentThread()) )
                   System.out.println("Running Thread");
                   whiletruemethod();
      public void listenSocket(){
         thisserver = 1;
        try{
          server = new ServerSocket(4444);
        } catch (IOException e) {
          System.out.println("Could not listen on port 4444");
          System.exit(-1);
         whiletrue = new Thread(this);
         whiletrue.start();
         }

    Have you thought of using the PoolExecutor by Dough Lea, to handle your thread creation and execution ?
    Its nice and easy to use, and most important works...!

Maybe you are looking for