Skip to content

Adaptive: Only use ThreadLocal if called from FastThreadLocalThread i…#14656

Merged
normanmaurer merged 1 commit into4.1from
tl_buffer
Jan 13, 2025
Merged

Adaptive: Only use ThreadLocal if called from FastThreadLocalThread i…#14656
normanmaurer merged 1 commit into4.1from
tl_buffer

Conversation

@normanmaurer
Copy link
Copy Markdown
Member

…… (#14625)

…n case of temporary byte[] allocation

Motivation:

We should only use ThreadLocal's if we are sure we are using a FastThreadLocalThread. This ensures the allocator and buffers are Virtual Thread friendly

Modifications:

Check instance of Thread and only use ThreadLocal if its an instance of FastThreadLocalThread

Result:

Fixes #14609

#14625)

…n case of temporary byte[] allocation

Motivation:

We should only use ThreadLocal's if we are sure we are using a
FastThreadLocalThread. This ensures the allocator and buffers are
Virtual Thread friendly

Modifications:

Check instance of Thread and only use ThreadLocal if its an instance of
FastThreadLocalThread

Result:

Fixes #14609
@normanmaurer normanmaurer added this to the 4.1.117.Final milestone Jan 13, 2025
@normanmaurer normanmaurer merged commit 4d1f98d into 4.1 Jan 13, 2025
@normanmaurer normanmaurer deleted the tl_buffer branch January 13, 2025 10:35
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.

ByteBufUtil.threadLocalTempArray() may need to provide a non-threadlocal implementation

1 participant