Skip to content

Use high-performance clocks instead of frequent system calls.#4441

Closed
iwangjie wants to merge 7 commits intoapache:masterfrom
iwangjie:sys_clock_util
Closed

Use high-performance clocks instead of frequent system calls.#4441
iwangjie wants to merge 7 commits intoapache:masterfrom
iwangjie:sys_clock_util

Conversation

@iwangjie
Copy link
Copy Markdown
Contributor

@iwangjie iwangjie commented Mar 6, 2023

System.currentTimeMillis () frequently switches from user mode to kernel mode

The system has only one global clock source, and high concurrency or frequent access will cause serious contention

ShenyuClock Accuracy of 1 MILLISECONDS, compatible with most scenarios, especially in high-frequency access.

The operation can be completed in user mode, which reduces the loss of entering kernel mode.

https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8185891

🤔I think it can be used in the load balancer, Seek community views.

@iwangjie iwangjie marked this pull request as draft March 6, 2023 07:23
@iwangjie iwangjie closed this Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants