Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

J.U.C之AQS原理-CLH队列 | 人淡如菊 #25

Open
kongjun01 opened this issue Nov 12, 2020 · 0 comments
Open

J.U.C之AQS原理-CLH队列 | 人淡如菊 #25

kongjun01 opened this issue Nov 12, 2020 · 0 comments

Comments

@kongjun01
Copy link
Owner

https://www.panaihua.com/aqs-clh/

CLH 同步队列是一个 FIFO 双向队列,AQS 依赖它来完成同步状态的管理:当前线程如果获取同步状态失败时,AQS则会将当前线程已经等待状态等信息构造成一个节点(Node)并将其加入到CLH同步队列,同时会阻塞当前线程。当同步状态释放时,会将某个节点唤醒(是否首节点取决于公平锁/非公平锁),使其再次尝试获取同步状态。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant