WRT54GS v.6 Problem (Final Thread)

I am getting tired of this thing, and I'm sure you guys are getting tired of me posting a million threads about my blasted Router.
So, I have updated my WRT54GS v.6 with the most recent firmware, and I use a PPoPE connection... but it still keeps randomly disconnecting from my computer... 
Anyways, this is my final thread I'm going to make.  If you guys can't help, then the only thing I could do is get a new router...

Are you trying to connect to your router by wire or wirelessly?
For now, please use all wired connections.  If your computer has a wireless adapter, please turn it off.  If you have more than one computer connected to your router, please disconnect all but one of them.
Your system should be wired as follows:
Modem -- router -- computer
The ethernet port on the modem should be connected (by ethernet cable) to the Internet port of the router.
Connect router LAN port 1, by ethernet cable, to your computer.
If your modem has a USB port, do not connect it to anything.
1) Please state your ISP.
2) Please state the make and exact model number of your modem (not the WRT54GS).
3) Please use the following procedure to reset your router to factory defaults, and report your results:
You need to try again to reset the router to factory defaults.
To reset your router to factory defaults, use the following procedure:
1) Power down all computers, the router, and the modem, and unplug them from the wall.
2) Disconnect all wires from the router.
3) Power up the router and allow it to fully boot (1-2 minutes).
4) Press and hold the reset button for 30 seconds, then release it, then let the router reset and reboot (2-3 minutes).
5) Power down the router.
6) Connect one computer by wire to port 1 on the router (NOT to the internet port).
7) Power up the router and allow it to fully boot (1-2 minutes).
8) Power up the computer (if the computer has a wireless card, make sure it is off).
9) Try to ping the router. To do this, click the "Start" button > All Programs > Accessories > Command Prompt. A black DOS box will appear. Enter the following: "ping 192.168.1.1" (no quotes), and hit the Enter key. You will see 3 or 4 lines that start either with "Reply from ... " or "Request timed out." If you see "Reply from ...", your computer has found your router.
10) Open your browser and point it to 192.168.1.1. This will take you to your router's login page. Leave the user name blank, and in the password field, enter "admin" (with no quotes). This will take you to your router setup page. Note the version number of your firmware (usually listed near upper right corner of screen). Exit your browser.
If you get this far without problems, try the setup disk (or setup the router manually, if you prefer), and see if you can get your router setup and working.
If you cannot get "Reply from ..." in step 9 above, your router is likely dead.  Please report back with this problem.
If you get a reply in step 9, but cannot complete step 10, then either your router is dead, the firmware is corrupt, or the computer is having problems talking to the router.  Report back with this problem.
If you need additional help, please report back the results of steps 9 and 10.  Also, if you get any error messages, copy them exactly and report back.
Please let me know how things turn out for you.
Message Edited by toomanydonuts on 01-27-2009 01:34 AM

Similar Messages

  • Problem with Thread and InputStream

    Hi,
    I am having a problem with threads and InputStreams. I have a class which
    extends Thread. I have created and started four instances of this class. But
    only one instance finishes its' work. When I check the state of other three
    threads their state remains Runnable.
    What I want to do is to open four InputStreams which are running in four
    threads, which reads from the same url.
    This is what I have written in my thread class's run method,
    public void run()
         URL url = new URL("http://localhost/test/myFile.exe");
    URLConnection conn = url.openConnection();
    InputStream istream = conn.getInputStream();
    System.out.println("input stream taken");
    If I close the input stream at the end of the run method, then other threads
    also works fine. But I do not want to close it becuase I have to read data
    from it later.
    The file(myFile.exe) I am trying to read is about 35 MB in size.
    When I try to read a file which is about 10 KB all the threads work well.
    Plz teach me how to solve this problem.
    I am using JDK 1.5 and Win XP home edition.
    Thanks in advance,
    Chamal.

    I dunno if we should be doing such things as this code does, but it works fine for me. All threads get completed.
    public class ThreadURL implements Runnable
        /* (non-Javadoc)
         * @see java.lang.Runnable#run()
        public void run()
            try
                URL url = new URL("http://localhost:7777/java/install/");
                URLConnection conn = url.openConnection();
                InputStream istream = conn.getInputStream();
                System.out.println("input stream taken by "+Thread.currentThread().getName());
                istream.close();
                System.out.println("input stream closed by "+Thread.currentThread().getName());
            catch (MalformedURLException e)
                System.out.println(e);
                //TODO Handle exception.
            catch (IOException e)
                System.out.println(e);
                //TODO Handle exception.
        public static void main(String[] args)
            ThreadURL u = new ThreadURL();
            Thread t = new Thread(u,"1");
            Thread t1 = new Thread(u,"2");
            Thread t2 = new Thread(u,"3");
            Thread t3 = new Thread(u,"4");
            t.start();
            t1.start();
            t2.start();
            t3.start();
    }And this is the o/p i got
    input stream taken by 2
    input stream closed by 2
    input stream taken by 4
    input stream closed by 4
    input stream taken by 3
    input stream closed by 3
    input stream taken by 1
    input stream closed by 1
    can u paste your whole code ?
    ram.

  • Problem: Final Cut Pro X inaccurately reports "Out of disk space", when I have 333GB free.

    Problem: Final Cut Pro X inaccurately reports "Out of disk space", when I have 333GB free.
    Trying to "share" the compound clip I've created as an mp4 1080p file.

    Editing MP4 media can create all sorts of havoc with FCP.
    Convert the clips to .mov files – either Compressor or MPEG Streamclip will do that – preferably in Pro Res 422
    Russ

  • I am having some problems finalizing the project, it says error code -108. I read some tips but i couldn't figure out what AppleMan1958 suggested ,can someone explain this to me ,thank you

    I am having some problems finalizing the project, it says error code -108. I read some tips but i couldn't figure out what AppleMan1958 suggested ,can anyone help me with this problem? thank you

    Oh ok, well that was what the test said prior to reformatting the hard drive. Now, it doesn't find any trouble no matter how many times I run it. That's what has me so confused, everything seems to check out and yet...I can't do anything, not even install the software!

  • Problem with threads within applet

    Hello,
    I got an applet, inside this applet I have a singleton, inside this singleton I have a thread.
    this thread is running in endless loop.
    he is doing something and go to sleep on and on.
    the problem is,
    when I refresh my IE6 browser I see more than 1 thread.
    for debug matter, I did the following things:
    inside the thread, sysout every time he goes to sleep.
    sysout in the singleton constructor.
    sysout in the singleton destructor.
    the output goes like this:
    when refresh the page, the singleton constructor loading but not every refresh, sometimes I see the constructor output and sometimes I dont.
    The thread inside the singleton is giving me the same output, sometime I see more than one thread at a time and sometimes I dont.
    The destructor never works (no output there).
    I don't understand what is going on.
    someone can please shed some light?
    thanks.
    btw. I am working with JRE 1.1
    this is very old and big applet and I can't convert it to something new.

    Ooops. sorry!
    I did.
         public void start() {
         public void stop() {
         public void destroy() {
              try {
                   resetAll();
                   Configuration.closeConnection();
                   QuoteItem.closeConnection();
              } finally {
                   try {
                        super.finalize();
                   } catch (Throwable e) {
                        e.printStackTrace();
         }

  • Problem with Threads and "plase wait..."-Window

    Hi everyone,
    I have a problem that I'm not able to solve in any way... I have a time-consuming task (a file decryption) which I execute in a separate thread; I've used the SwingWorker class, like suggested by sun-tutorial, and it works right. The problem is that I have to wait that the decryption have finished before continuing with program-execution. Therefore I would like to display a "please wait"-window while the task runs. I've tryed all the possible ways I know but the problem is always the same: the waitWindow is displayed empty, the bounds are painted but the contents no; it's only painted when the decrypt-task has finished. Please help me, I have no more resources....
    decrypt-file code:
    public class DecryptFile {
      private String cryptedFileNameAndPath;
      private ByteArrayInputStream resultStream = null;
      // need for progress
      private int lengthOfTask;
      private int current = -1;
      private String statMessage;
      public DecryptFile(String encZipFileNameAndPath) {
        cryptedFileNameAndPath = encZipFileNameAndPath;
        //Compute length of task...
        // 0 for indeterminate
        lengthOfTask = 0;
      public ByteArrayInputStream getDecryptedInputStream() {
        return this.resultStream;
       * Called from ProgressBarDemo to start the task.
      public void go() {
        current = -1;
        final SwingWorker worker = new SwingWorker() {
          public Object construct() {
            return new ActualTask();
        worker.start();
       * Called from ProgressBarDemo to find out how much work needs
       * to be done.
      public int getLengthOfTask() {
        return lengthOfTask;
       * Called from ProgressBarDemo to find out how much has been done.
      public int getCurrent() {
        return current;
      public void stop() {
        current = lengthOfTask;
       * Called from ProgressBarDemo to find out if the task has completed.
      public boolean done() {
        if (current >= lengthOfTask)
          return true;
        else
          return false;
      public String getMessage() {
        return statMessage;
       * The actual long running task.  This runs in a SwingWorker thread.
      class ActualTask {
        ActualTask () {
          current = -1;
          statMessage = "";
          resultStream = AIUtil.getInputStreamFromEncZip(cryptedFileNameAndPath); //here the decryption happens
          current = 0;
          statMessage = "";
      }The code that calls decryption and displays waitWindow
          final WaitSplash wS = new WaitSplash("Please wait...");
          final DecryptFile cryptedTemplate = new DecryptFile (this.templateFile);
          cryptedTemplate.go();
          while (! cryptedTemplate.done()) {
            try {
              wait();
            } catch (Exception e) { }
          this.templateInputStream = cryptedTemplate.getDecryptedInputStream();
          wS.close();Thanks, thanks, thanks in advance!
    Edoardo

    Maybe you can try setting the priority of the long-running thread to be lower? so that the UI will be more responsive...

  • Problem with threads and camera.

    Hi everybody!
    I've a problem with taking snapshot.
    I would like to display a loading screen after it take snapshot ( sometimes i
    have to wait few seconds after i took snapshot. Propably photo is being taken in time where i have to wait).
    I was trying to use threads but i didn't succeed.
    I made this code:
    display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while((!performing.isShown()) && (backgroundCamera.isShown())){
                        Thread.yield();
                    notifyAll();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        this.wait();                   
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();This code is sometimes showing performing screen but sometimes no.
    I don't know why. In my opinion performing.isShown() method isn't working correctly.
    Does anyone have some idea how to use threads here?

    Hi,
    I've finally managed to work this fine.
    The code:
           Object o = new Object();
           display.setCurrent(perform);               
            new Thread(new Runnable(){
                public void run() {               
                    while(!performing.isShown()){
                        Thread.yield();
                   synchronized(o) {
                      o.notify();
            }).start();
            new Thread(new Runnable(){
                public void run() {
                    try {
                        synchronized(o) {
                           o.wait(1);
                    } catch(Exception e) {
                        exceptionHandler(e);
                    photo = camera.snapshot();                               
                    display.setCurrent(displayPhoto);
            }).start();

  • Problem with threads hanging

    We have a problem where our application stops responding after a few days of usage. Things will for fine for a day or two, and then pretty quickly threads will start getting hung up, usually in places where they are allocating memory
    We are running WebLogic 8.1 SP2 on Sun JDK 1.4.2_04 on Solaris 8 using the alternate threading model and the -server hotspot vm. We are running pretty much the same code that we had no problems with under WebLogic 6.1 SP4 and Sun JDK 1.3.1.
    A thread dump usually shows that some or all of our execute threads are in the state "waiting for monitor entry" even though they are not currently waiting on any java locks. Here is a sample thread from the thread dump (we have ~120 threads so I don't want to post the full dump).
    =============================================================================================
    "ExecuteThread: '8' for queue: 'itgCrmWarExecutionQueue'" daemon prio=5 tid=0x005941d0 nid=0x2c waiting for monitor entry [c807f000..c807fc28]
    at java.lang.String.substring(String.java:1446)
    at java.lang.String.substring(String.java:1411)
    at weblogic.servlet.internal.ServletRequestImpl.getRelativeUri(ServletRequestImpl.java:1872)
    at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3492)
    at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
    =============================================================================================
    String.java line 1446 for this jdk allocates a new String object, and all the other threads in this state also are creating new objects or arrays, etc.
    We've done a pstack on this process when it's in this state, and the threads that are in the "waiting for monitor entry" that look like they're allocating memory are all waiting on the same lwp_mutex_lock with some allocation method that's calling into the native TwoGenerationCollectorPolicy.mem_allocate_work (see pstack output below for the same thread as in the thread dump above)
    =============================================================================================
    ----------------- lwp# 44 / thread# 44 --------------------
    ff31f364 lwp_mutex_lock (e3d70)
    fee92384 __1cNObjectMonitorGenter26MpnGThread__v_ (5000, 525c, 5000, 50dc, 4800, 4af0) + 2d8
    fee324d4 __1cSObjectSynchronizerKfast_enter6FnGHandle_pnJBasicLock_pnGThread__v_ (c807f65c, c807f7d4, 5941d0, 0, 35d654, fee328ec) + 68
    fee32954 __1cQinstanceRefKlassZacquire_pending_list_lock6FpnJBasicLock__v_ (c807f7d4, ff170000, d4680000, 4491d4, fee1bc2c,
    0) + 78
    fee3167c __1cPVM_GC_OperationNdoit_prologue6M_i_ (c807f7bc, 4400, ff170000, 2d2b8, 4a6268, c807fa18) + 38
    fee2e0b0 __1cIVMThreadHexecute6FpnMVM_Operation__v_ (c807f7bc, 963a8, 0, 0, 1, 0) + 90
    fed2c2a4 __1cbCTwoGenerationCollectorPolicyRmem_allocate_work6MIii_pnIHeapWord__ (962c0, ff1c29ec, ff1c297c, ff131a26, 4800, 4998) + 160
    fed22940 __1cNinstanceKlassRallocate_instance6MpnGThread__pnPinstanceOopDesc__ (ee009020, 5941d0, 15ca581, 3647f0, 4a6268, c807f8c8) + 180
    fed34928 __1cLOptoRuntimeFnew_C6FpnMklassOopDesc_pnKJavaThread__v_ (ee009018, 5941d0, 0, 0, 0, 0) + 28
    fa435a58 ???????? (ee009018, e86de, 15ca4de, 50dc, 5941d0, c807f9c8)
    fb36f9a4 ???????? (0, d412ccd8, ee046c28, ff170000, 0, 0)
    fad8b278 ???????? (ee046c28, d6000c90, ee046530, 8, db8e8450, c807f9e8)
    fad62abc ???????? (d412ccd8, ee046530, d6000c90, ee3bfa38, 8, c807fa18)
    fa4b3c38 ???????? (c807fb9c, 0, f2134700, fa415e50, 8, c807faa8)
    fa40010c ???????? (c807fc28, c807fe90, a, ee9e1e20, 4, c807fb40)
    fed5d48c __1cJJavaCallsLcall_helper6FpnJJavaValue_pnMmethodHandle_pnRJavaCallArguments_pnGThread__v_ (c807fe88, c807fcf0, c807fda8, 5941d0, 5941d0, c807fd00) + 27c
    fee4b784 __1cJJavaCallsMcall_virtual6FpnJJavaValue_nLKlassHandle_nMsymbolHandle_4pnRJavaCallArguments_pnGThread__v_ (ff170000, 594778, c807fd9c, c807fd98, c807fda8, 5941d0) + 164
    fee5e8dc __1cJJavaCallsMcall_virtual6FpnJJavaValue_nGHandle_nLKlassHandle_nMsymbolHandle_5pnGThread__v_ (c807fe88, c807fe84, c807fe7c, c807fe74, c807fe6c, 5941d0) + 6c
    fee6fc74 __1cMthread_entry6FpnKJavaThread_pnGThread__v_ (5941d0, 5941d0, 838588, 594778, 306d10, fee69254) + 128
    fee6927c __1cKJavaThreadDrun6M_v_ (5941d0, 2c, 40, 0, 40, 0) + 284
    fee6575c _start   (5941d0, fa1a1600, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Also when it's having this problem, the "VM Thread" is always using a lot of processor time. We did a couple of pstacks today while it was having this problem, and this thread was stuck in the ONMethodSweeper.sweep for over 15 minutes when we finally killed the server.
    From the thread dump:
    "VM Thread" prio=5 tid=0x000e2d20 nid=0x2 runnable
    From the first pstack:
    =============================================================================================
    ----------------- lwp# 2 / thread# 2 --------------------
    fed40c04 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (42a2f4, fa5fa46d, ffffffff, fc4ffcb8, 42a2f4, 42a324) + 124
    fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (42a2f0, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
    fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (fa5f7f88, fa608940, 1, 0, fa400000, 6) + 1ac
    fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
    fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
    feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
    feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
    fee6575c _start   (e2d20, ff270200, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Second pstack
    =============================================================================================
    ----------------- lwp# 2 / thread# 2 --------------------
    fed41180 __1cXvirtual_call_RelocationIparse_ic6FrpnICodeBlob_rpC5rppnHoopDesc_pi_nNRelocIterator__ (0, ff1b9664, ffffffff, fc4ffcb8, a6f2cc, fc4ffbd0) + 6a0
    fed46318 __1cKCompiledIC2t5B6MpnKRelocation__v_ (a6f2c8, fc4ffd24, fc4ffd4c, e802, 0, 6) + 38
    fed90c38 __1cHnmethodVcleanup_inline_caches6M_v_ (faded4c8, fadf2c80, 1, 0, fa400000, 6) + 1ac
    fede18b4 __1cONMethodSweeperFsweep6F_v_ (2cf38, 0, ffffffff, ff1cf1fc, ff1c66e8, fede1d44) + 1b0
    fede1e6c __1cUSafepointSynchronizeFbegin6F_v_ (2cf38, ff1ba138, 5000, 50dc, 5000, 525c) + 248
    feef1fd4 __1cIVMThreadEloop6M_v_ (4400, 4000, 4324, 4000, 42b0, 3800) + 3d4
    feef1ae4 __1cIVMThreadDrun6M_v_ (e2d20, 2, 40, 0, 40, 0) + 8c
    fee6575c _start   (e2d20, ff270200, 0, 0, 0, 0) + 134
    ff3758c0 lwpstart (0, 0, 0, 0, 0, 0)
    =============================================================================================
    Has anyone ever seen anything like this? I'm trying to figure out if this is caused by something we're doing, or something relating to our environment and jvm options. Any ideas?

    Thanks for the reply - I'm testing our app with the +UseConcMarkSweepGC now in our test environment to make sure it doesn't cause any problems there.  Unfortunately the only place we've had this problem is on the production server, so it's extra difficult debugging this. 
    We're using the following memory options:
    -ms512m -mx512m -XX:NewSize=128m -XX:PermSize=192m -XX:MaxNewSize=128m -XX:MaxPermSize=192m -XX:SurvivorRatio=8and the following debugging options, as we've also been seeing OutOfMemoryErrors ( see http://forum.java.sun.com/thread.jsp?forum=37&thread=522354&tstart=45&trange=15 )
    -verbosegc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGCBTW, which c++filt version and options are you using? Our Solaris boxes only seem to have the GNU version installed. I was trying to run that on some of the other stack traces and wasn't getting anywhere, and didn't know if because it was GNU version wouldn't work on something compiled with the Sun compiler.
    Thanks!
    --Andy                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Having a problem with threads and using locks

    I was hoping someone could give me some hits on getting my code to run properly. The problem I am having is I think my locks and unlocks are not working properly. Plus, for some reason I always get the same output, which is:
    Withdrawal Threads         Deposit Threads            Balance
    Thread 2 attempts $29 Withdrawal - Blocked - Insufficient Funds
    Thread 4 attempts $45 Withdrawal - Blocked - Insufficient Funds
    Thread 6 attempts $34 Withdrawal - Blocked - Insufficient Funds
    Thread 7 attempts $40 Withdrawal - Blocked - Insufficient Funds
                                    Thread 1 deposits $187          $187
                                    Thread 3 deposits $169          $356
                                    Thread 5 deposits $61           $417
    Press any key to continue...If someone can see the error I made and doesn't mind explaining it to me, so I can learn from it, I would appreciate that very much.
    /************Assign2_Main.java************/
    import java.util.concurrent.*;
    public class Assign2_Main
    {//start Assign2_Main
        public static void main(String[] args)
        {//start main
               // create ExecutorService to manage threads
               ExecutorService threadExecutor = Executors.newCachedThreadPool();
            Account account = new SynchronizedThreads();
            Deposit deposit1 = new Deposit(account, "Thread 1");
            Deposit deposit2 = new Deposit(account, "Thread 3");
            Deposit deposit3 = new Deposit(account, "Thread 5");
            Withdrawal withdrawal1 = new Withdrawal(account, "Thread 2");
            Withdrawal withdrawal2 = new Withdrawal(account, "Thread 4");
            Withdrawal withdrawal3 = new Withdrawal(account, "Thread 6");
            Withdrawal withdrawal4 = new Withdrawal(account, "Thread 7");
            System.out.println("Withdrawal Threads\t\tDeposit Threads\t\t\tBalance");
            System.out.println("------------------\t\t---------------\t\t\t-------\n");
            try
                threadExecutor.execute(withdrawal1);       
                threadExecutor.execute(deposit1);     
                threadExecutor.execute(withdrawal2);  
                threadExecutor.execute(deposit2);    
                threadExecutor.execute(withdrawal3);
                threadExecutor.execute(deposit3);       
                threadExecutor.execute(withdrawal4);
            catch ( Exception e )
                 e.printStackTrace();
                //shutdown worker threads
               threadExecutor.shutdown();
        }//end main
    }//end Assign2_Main/******************Withdrawal.java****************************/
    public class Withdrawal implements Runnable
    {//start  class Withdrawal
          *constructor
        public Withdrawal(Account money, String n)
             account = money;
             name = n;
        public void run()
        {//start ruin
             int newNum = 0;
                newNum = account.getBalance(name); 
               Thread.yield();
        }//end run
        private Account account;
        private String name;
    }//end  class Withdrawal/*******************Deposit.java***************/
    import java.util.Random;
    public class Deposit implements Runnable
    {//start class Deposit
          *constructor
        public Deposit(Account money, String n)
             account = money;
             name = n;
        public void run()
        {//start run
                try
                     Thread.sleep(100);
                   account.setBalance(random.nextInt(200), name);
                }// end try
                catch (InterruptedException e)
                  e.printStackTrace();
       }//end run
       private Account account;
       private Random random = new Random();
       private String name;
    }//end class Deposit/********************Account.java*****************/
    *Account interface specifies methods called by Producer and Consumer.
    public interface Account
         //place sum into Account
         public void setBalance(int sum, String name);
         //return  value of Account
            public int getBalance(String name);         
    } /**************SynchronizedThreads.java****************/
    import java.util.concurrent.locks.*;
    import java.util.Random;
    public class SynchronizedThreads implements Account
    {//start SynchronizedThreads
          *place money into buffer
        public void setBalance(int amount, String name)
        {//start setBalance
             // lock object
             myLock.lock();           
            sum += amount;
            System.out.println("\t\t\t\t" + name + " deposits $" + amount +"\t\t$"+ sum+"\n");       
               //threads are singnaled to wakeup
            MakeWD.signalAll();
              // unlock object                                                
            myLock.unlock();
           }//end setBalance
            *gets the balance from buffer
           public int getBalance(String name)
        {//start getBalance
             int NewSum = random.nextInt(50);
             //lock object
            myLock.lock();
            try
                 if(sum > NewSum)
                     //takes NewSum away from the account
                     sum -= NewSum;
                        System.out.println(name + " withdraws $" + NewSum +"\t\t\t\t\t\t$"+ sum+"\n");
                else
                     System.out.println(name +  " attempts $" + NewSum + " Withdrawal - Blocked - Insufficient Funds\n");                 
                     //not enough funds so thread waits
                        MakeWD.await();         
                //threads are singnaled to wakeup
                MakeD.signalAll();     
                }//end try
            catch (InterruptedException e)
                   e.printStackTrace();
            finally
                 //unlock object
                 myLock.unlock();
            return NewSum;     
         }//end getBalance
         private Random random = new Random();  
         private Lock myLock = new ReentrantLock();
         private Condition MakeD = myLock.newCondition();
         private Condition MakeWD = myLock.newCondition();
         private int sum = 0;
    }//end SynchronizedThreads

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • Creation  of components in dinamic way. Problem with threads....?

    hi,
    I am trying to add components (JTextFields) to a JPanel in dynamic way.
    I would like that the user decides the number of the components, to
    be created, for executing a function by clicking a button.
    But clicking on the button, the elaboration doesn't produce the creation
    of the JTextFields.
    Debugging the code I saw that the same function works well
    when it is called from the normal data flow of the elaboration
    instead that it is called from inside a listener.
    It is hard for me to understand the reason why this
    happens, as well I could think that this problem could happen
    because the execution of different threads.
    But I am not able to manage those kind of situations....
    I would like to have a little help
    thank you
    regards
    tonyMrsangelo.
    To reproduce the problem I post some code where the function (setComponentInThePanel())
    is called from the constructor of the class and from the listener of a JButton.
    package labels;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JSpinner;
    import javax.swing.JTextField;
    import javax.swing.SpinnerNumberModel;
    public class LabelsDialogMain extends JFrame {
        PanelCanvas jPanCanvas = new PanelCanvas();
        PanelDesign jPanDesign = new PanelDesign();
        PanelCommands jPanCommands = new PanelCommands(jPanDesign);
        /** Creates new form MainLabelsDialog */
        public LabelsDialogMain() {
            java.awt.GridBagConstraints gridBagConstraints;
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            getContentPane().setLayout(new java.awt.GridBagLayout());
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 0;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.gridheight = 2;
            getContentPane().add(jPanCanvas, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 3;
            gridBagConstraints.gridy = 0;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.gridheight = 2;
            getContentPane().add(jPanDesign, gridBagConstraints);
            gridBagConstraints = new java.awt.GridBagConstraints();
            gridBagConstraints.gridx = 1;
            gridBagConstraints.gridy = 2;
            gridBagConstraints.gridwidth = 4;
            gridBagConstraints.gridheight = 2;
            getContentPane().add(jPanCommands, gridBagConstraints);
            pack();
         * @param args the command line arguments
        public static void main(String args[]) {
             LabelsDialogMain mld = new LabelsDialogMain();
             mld.setVisible(true);
    class PanelCanvas extends JPanel {
        public PanelCanvas() {
            Dimension d = new Dimension(400,200);
            setPreferredSize(d);
            setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Panel Canvas", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Comic Sans MS", 0, 11), new java.awt.Color(0, 255, 255))); // NOI18N
    } // class PanelCanvas
    class PanelDesign extends JPanel {
        JTextField textField [];
        public PanelDesign() {
            Dimension d = new Dimension(400,200);
            setPreferredSize(d);
            setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Panel Design", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Comic Sans MS", 0, 11), new java.awt.Color(0, 255, 255))); // NOI18N
        void setComponentInThePanel(int dim ){
             textField = new  JTextField[dim];
             for (int i = 0; i < dim; i++){
                 textField[i] = new  JTextField("----- " + i);
                 add(textField);
    System.out.println("executed the nmbr: " + i);
    repaint();
    } // setComponentInThePanel()
    } // class PanelDesign
    class PanelCommands extends JPanel {
    PanelDesign panelDesign;
    private javax.swing.JLabel jLblRowNmbr;
    private javax.swing.JSpinner jSpinner;
    JButton dummyButton = new JButton("button");
    public PanelCommands(PanelDesign pnlDesign) {
    panelDesign = pnlDesign;
    Dimension d = new Dimension(800,200);
    setPreferredSize(d);
    setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Panel Cmmands", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Comic Sans MS", 0, 11), new java.awt.Color(0, 255, 255))); // NOI18N
    jLblRowNmbr = new javax.swing.JLabel();
    jSpinner = new JSpinner();
    jLblRowNmbr = new JLabel();
    add(jLblRowNmbr);
    add(jSpinner);
    add(dummyButton);
    jSpinner.setModel(new javax.swing.SpinnerNumberModel(Short.valueOf((short)1), Short.valueOf((short)1), null, Short.valueOf((short)1)));
    final SpinnerNumberModel sm = (SpinnerNumberModel) this.jSpinner.getModel();
    jLblRowNmbr.setText("N. of the rows");
    // panelDesign.setComponentInThePanel(4); "take out the comment of this row to get the creation of JTextFields"
    dummyButton.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    Number amp = sm.getNumber();
    int ampInt = amp.intValue();
    panelDesign.setComponentInThePanel(ampInt);
    // panelDesign.setComponentInThePanel(4);
    JOptionPane.showMessageDialog(jSpinner, "spinner = " + ampInt);
    } // class PanelCommands

    When you add/remove components to a panel when the GUI has already been created then you need to use:
    panel.revalidate();
    panel.repaint();

  • Problem w/ thread in Database forum?

    Is there a problem with this thread?
    Datablock writes
    Most threads that are answered will say "This thread is answered." and below one of the post will be marked "Correct". In this thread, it says "This question is answered. Helpful answers available: 5. Correct answers available: 1." And below, none of the replies is marked as "Correct".
    -Mark

    Yes I understand Mark. I do favor this that when the poster is satisfied with the answers and is finally going to close the question, he should mark the right or near-to-right answer not just for him but for others as well, who in future may look at that thread for the same question. But I guess, at times, people either are in just too much of hurry or don't bother to press few extra clicks of mouse.
    + realize I'm not as active on the Forums as some people, but I've answered my share of questions.
    Yet, if you look at my profile, it says "25 points (newbie)". I can only assume it's cause I have a knack for consistently answering questions from people who don't bother to award points.+
    I really don't think that the points decide how much knowledgable a person is. Yesterday, I was writing some notes, doing some research with block dumps, almost all the threads that I found over web, you were there, explaining the contents of it. Please trust me when I say this, your answers are among the best ones over here for some of the toughest topics. I remember very well your answers over the threads for Dirty Buffers and Pinned buffers. At least for me, it doesn't matter what the profile shows , I know who are the best guys over this forum and over the other places where I look for answers. That's the same for my profile as well, which says, Guru when I am so so many miles far from being called that :-) .
    best regards
    Aman....

  • WRT54G v5 fw problems

    Hy all.
    I have a big problem. I have a wrt54g v5 router, and tried to upgrade fw, but wasn't successfull and i have a brick. made a jtag cabel and tried to repair, but can't flash any fw.I woluld like to restore the factory fw, can you help me?
    Thanks, by Tom-ee

    sounds like a bad flash. Probably the firmware already on the router is corrupt, and trying to flash over it will not work, even with a good image.....you will need to refer to the DD-WRT directions on recovery that I posted a link to earlier in this thread.
    Tomato 1.25vpn3.4 (SgtPepperKSU MOD) on a Buffalo WHR-HP-G54
    D-Link DSM-320 (Wired)
    Wii (Wireless) - PS3 (Wired), PSP (Wireless) - XBox360 (Wired)
    SonyBDP-S360 (Wired)
    Linksys NSLU2 Firmware Unslung 6.10 Beta unslung to a 2Gb thumb, w/1 Maxtor OneTouch III 200Gb
    IOmega StorCenter ix2 1TB NAS
    Linksys WVC54G w/FW V2.12EU
    and assorted wired and wireless PCs and laptops

  • WRT54G updating firmware problem

    I am trying to update a WRT54G v5 firmware using the TFTP.exe.  When I enter the ip address (192.168.1.1) and my password, select the FW_WRT54Gv5v6_1.02.7.011_EN_20090727.bin file, click "Upgrade", I get "unable to get responses from server". 
    I am able to connect to the router via IE. 
    Any suggestions?
    Solved!
    Go to Solution.

    Hi,
    I have a similar problem but neither  via webpage and tftp.exe do not work.
    I need to do an upgrade because my webpage looks like ... it was mostly empty. Most of information is missing. And it looks like this on different computers, different softwears (firefox, ie, chrome, opera) and even deferent ethernet (I also tried to set it in my sister house, she has a differenet internet provider)... I can't tell when it happend. Once I just wanted to change wi-fi settings and it was like that. 
    After some trying (looking inside the source of page) I finally get to the page you should browse and browsed an upgrade file but OFCOROUSE "upgrade" button was also invisible and absent....
    So...
    I've read some more and found the solution: tftp.exe. I've download that, tried... and had the same problem. The information is: "unable to get response from server".
    Guys, I really do not know what to do... I don't like the idea to buy a new router but I'm getting afraid that this is the only solution...
    PS. If such problem was ovewritten somewhere else - I'm sorry. I could not find any similar. That's why I'm waiting.
    I would be very happy for any help, and if someone is from Warsaw, Poland - I can buy a beer
    PS 2. sorry for such plain and poor explenation, but I'm only a "lady"
    Best,
    dt 

  • K8N Neo2 SATA Raid problem finally solved

    Hi guys,
    finally got my SATA Raid 0 array to work.
    Problem was that XP didn't find a correct array on installation although i used F6
    to load drivers from disk. Sometimes it didn't detect any hard disk, sometimes
    it showed two hd's and an array and so...
    The whole spectrum of errors mentioned here over the last days and weeks...
    I tried different bios like 1.1, 1.2, 1.2b5, 1.3b5 and i got the newest drivers
    directly from nvidia as mentioned in some other thread. Nothing worked.
    One should think that nvidia would have the latest drivers... but that was the
    major fault.
    As mentioned in a different thread i downloaded the unified nforce drivers from
    nvidia's homepage and extracted the ide drivers to a floppy. I used these drivers
    in all of my attempts and it never worked..
    Yesterday i downloaded the MSI Nvidia nForce3 System Drivers package 5.03 from
    http://www.msi.com.tw/program/support/download/dld/spt_dld_detail.php?UID=607&kind=1
    and compared the version numbers to the files from the nvidia package.
    The relevant files nvatabus.sys and nvraid.sys are version 5.10.2600.412 from
    nvidia while the MSI versions are 5.10.2600.446 !!
    I put these files on the disk, set up my bios (default 1.1) from scratch, started XP installation,
    hit F6, loaded the new drivers and voila... one 230 gb array ready for installation
    Took me FOUR days to figure this out. THANK YOU MSI support team,
    wherever you are.... (definitely not working on an updated hp)
    So to put it in one line:
    What really worked for me were the drivers from the MSI nforce3 driver package 5.03
    No messing around with beta bios, no voltage tweaking or SATA 3/4 preferred
    or DIMM Slot preferred crap.
    Of course you have to set up an raid array as described in rsheppicks raid setup guide
    Only thing about bios versions is that only in bios 1.1 i got an array shown in the
    hard disk boot priority list
    So i hope this helps you guys out there that are having troubles setting up SATA Raid.

    OK now! Dag, I was going crazy. I had two brand new Raptors and was trying to hook them up in a RAID 0 config. I am no dummy. It would hang at detecting arrays. I could not figure it out for the life of me. I will not talk about all of the combos that I tried. My buddy told me to try datalifeguard from WD. I did. Well, one HD showed no serial number in the extended test. An error message popped up. Said the drive was not working. So, Newegg sends me a dead drive and wastes days and days out of my life. I hooked up the one good drive just now. What do I see? For the first time in my life, I am seeing the raid bios! This almost cost me a divorce. Seriously though, the wife would come in and rub my shoulders like a fighter after a few hours of getting my azz whipped by this new rig. I am now going to make the floppy with the newer drivers like was done here. Just incase. I am in Raid bios now in the other room. Time to go set up XP on one drive for now. I refuse to wait for the RMA'ed second Raptor.

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

Maybe you are looking for

  • My iTunes is not playing any of my music.

    When i click on a song to add it to the play list, my iTunes will jump to another song and then not play any of my music. It doesn't act like it going to play anthing at all.  I've had this issue for two updates.

  • Retrieving file name using web agent

    When uploading to the database using interMedia web agent and an HTML form, is the file name (as well as the file contents) passed to the agent? If so, how does one retrieve the file name on the server side? Thanks for insight. -John

  • Regarding the exchange rate used in shopping cart

    Hi, Iam facing one problem regarding the currency conversion while crerating the shopping cart. The basic currency in my organizational profile is CHF. But I have a requirement to create a shopping cart in NZD(New Zealand dollars). After entering all

  • Histogram LR vs Camera Raw

    Why the histogram between Camera Raw and lightroom is different? When I make the black point and white point, the point of clipping, result different for the the same photo with same value. Let me know Thank's

  • Currency as per indian

    hi, I want to know any function module which shows the currency in Indian format for ex: now it is like 100,000.00           I want like 1,00,000.00 poinnts assured. regards, Prabhu