Search:

Type: Posts; User: helloworld922

Search: Search took 0.10 seconds.

  1. Re: Problem with some Java Homegrown Semaphore Code

    I am running a Windows dual core system (ran it earlier with a single core windows system, too) with:
    Java SE Runtime Environment (build 1.6.0_18-b07)
    Java Hotspot Client VM (build 16.0-b13, mixed...
  2. Re: Problem with some Java Homegrown Semaphore Code

    hmm... I ran your code (with the zipped java files this time) with that line commented out and left in. Neither case resulted in a thread left hanging indefinately, but only temporarily as it should...
  3. Re: Problem with some Java Homegrown Semaphore Code

    Ah.. I didn't see the zip :P I'll give it another look possible some time tonight.
  4. Re: Problem with some Java Homegrown Semaphore Code

    It looks like you forgot the line of code at the end of your "critical section" that resets the tWantsToEnter for your current thread. See Wikipedia: Peterson's Algorithm.

    Why having that printf...
Results 1 to 4 of 4