Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6968877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:30:32+00:00 2026-05-27T16:30:32+00:00

As the question goes. I’m using the JDK 6.0 on Windows 7, and am

  • 0

As the question goes. I’m using the JDK 6.0 on Windows 7, and am attempting to use semaphores as a mechanism to solve a synchronization problem. It works perfectly, but I’m trying to avoid busy waiting in my problem.

I would just ask the java documentation and spare SO the trouble, but the docs go like this:

Acquires the given number of permits from this semaphore,
 blocking until all are available, or the thread is interrupted.

Acquires the given number of permits, if they are available,
 and returns immediately, reducing the number of available permits
 by the given amount.

If insufficient permits are available then the current thread
 becomes disabled for thread scheduling purposes and lies dormant

http://docs.oracle.com/javase/6/docs/api/java/util/concurrent/Semaphore.html#acquire(int)

That is to say, the docs seem to be implying both answers. Which one is correct?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T16:30:33+00:00Added an answer on May 27, 2026 at 4:30 pm

    It’s clearly wait/notify due to this line:

    If insufficient permits are available then the current thread becomes disabled
    for thread scheduling purposes and lies dormant.

    This means the thread is not scheduled by the OS until the event to wake it up (available semaphore permits) occurs, at which point the thread is signaled to continue execution.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is my first question to stackoverflow so here it goes... I use cruise
i have this littel problem with a test app. Current look: <form> <span>1:Question goes
I'm using C++, but I think that my question goes beyond a single programming
My question is similar to Engram's here , but my question goes a bit
Ok, this may be a dumb question but here goes. I noticed something the
OK. This might be more of a math question but here goes. I have
This question might be kind of elementary, but here goes: I have a SQL
Probably a stupid question, but here goes. In my view, I have the following
Probably a long question for a simple solution, but here goes... I have a
Another clipboard question: When text is put onto the clipboard, it frequently goes in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.