LearnFrenzy
Sign in Take a free test

Concurrency and Executors · Concurrency and Executors MCQ · Question 18

What a Semaphore controls Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 18 Back to Exercise

What is a Semaphore with 3 permits used for?

  • A Running exactly 3 tasks
  • B Allowing at most 3 threads to use a resource at the same time Correct
  • C Counting to 3
  • D Creating 3 threads
Correct Answer: Option B

acquire() takes a permit, release() returns it.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links