GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — java-design-patterns/mutex/README.md at master · coding0011/java-design-patterns

Expand file tree

/

README.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
30 lines (23 loc) · 696 Bytes
/

README.md

Copy path

File metadata and controls

30 lines (23 loc) · 696 Bytes
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions
layout pattern
title Mutex
folder mutex
permalink /patterns/mutex/
categories Concurrency
tags
Java
Difficulty-Intermediate

Also known as

Mutual Exclusion Lock Binary Semaphore

Intent

Create a lock which only allows a single thread to access a resource at any one instant.

alt text

Applicability

Use a Mutex when

  • you need to prevent two threads accessing a critical section at the same time
  • concurrent access to a resource could lead to a race condition

Credits

  • [Lock (computer science)] (http://en.wikipedia.org/wiki/Lock_(computer_science))
  • [Semaphores] (http://tutorials.jenkov.com/java-concurrency/semaphores.html)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.