alibaba / alibaba/Sentinel

Why not implement a lock-free ArrayBucket

Open
#1,075 1 comment 0 reactions 0 assignees View on GitHub
kind/question
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

I wonder an implement question about the statics counting :
why not maintain current bucket pointer in a thread, when time of windowLengthInMs elapsed, reset the bucket's value to zero, then there's no need to use lock to lock the bucket anymore.

Contributor guide

Open the contributing guide

Research direction

Start by locating ArrayBucket and reading the statistics-counting path that uses windowLengthInMs and the current bucket pointer. Compare the proposed per-thread reset with the existing synchronization, then establish whether a safe design preserves counting semantics; the issue currently names no files, tests, or acceptance criteria.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.