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

Merge consecutive spin-loop blocks and remove redundant thread switches #556

Open
eupp opened this issue Mar 3, 2025 · 0 comments
Open

Comments

@eupp
Copy link
Collaborator

eupp commented Mar 3, 2025

The trace can contain several consecutive thread switches to the blocks of the same spin-loop.

Example:

|         /* The following events repeat infinitely: */                                |
|     ┌╶> state ➜ 0 at FutureTask.awaitDone(FutureTask.java:406)                       |
|     |   LockSupport.park(FutureTask#1) at FutureTask.awaitDone(FutureTask.java:447)  |
|     └╶╶ switch (reason: active lock detected)                                        |
|                                                                                      |
|                                                                                      |
|                                                                                      |
|                                                                                      |
|         /* The following events repeat infinitely: */                                |
|     ┌╶> state ➜ 0 at FutureTask.awaitDone(FutureTask.java:406)                       |
|     |   LockSupport.park(FutureTask#1) at FutureTask.awaitDone(FutureTask.java:447)  |
|     └╶╶ switch (reason: active lock detected)                                        |

| └╶╶ switch (reason: active lock detected) | | |

We need to fix this by merge several consecutive spin-loop blocks, and do not show redundant thread switches.

@eupp eupp changed the title Merge conse spin-loop blocks Merge consecutive spin-loop blocks and remove redundant thread switches Mar 3, 2025
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