RFR: Do not visit gc threads during shutdown

Y. Srinivas Ramakrishna ysr at openjdk.org
Tue Mar 21 00:51:19 UTC 2023


On Mon, 20 Mar 2023 21:02:53 GMT, William Kemper <wkemper at openjdk.org> wrote:

> 1. The shutdown sequence doesn't need to iterate over the threads.

Good!

> 2. The crashing thread wasn't "gone", but it's termination had been requested. It crashed in a call to get the thread's clock time (pthread_getcpuclockid). The thread's native handle should still have been valid. I didn't fully root cause the crash.

I assume you meant "the _GC thread that the control thread was iterating over_ wasn't gone, but its termination had been requested"?  I'd consider that as good as gone, absent any interlocking between the iteration and the termination of the target thread.

> 3. In this case, it was the control thread itself that was trying to iterate the threads. The fix here will stop the control thread from starting an iteration of the threads _after_ the shutdown sequence has begun, but it is not so robust to cover a shut down during an iteration of the threads.

May be one then needs a handshake/interlock with the control thread during the shutdown sequence if it's the only thread that iterates over these threads. (Or their termination could be delegated to the control thread, which is morally equivalent, and perhaps cleaner.) Is the case then that you have by your change above substantially narrowed the window of vulnerability, but not completely closed it? Or did I misunderstand?

-------------

PR Review Comment: https://git.openjdk.org/shenandoah/pull/228#discussion_r1142803142


More information about the shenandoah-dev mailing list