Skip to content

Store NativeDatagramPacketArray directly in the EpollEventLoop - #8062

Merged
normanmaurer merged 1 commit into
4.1from
native_datagram_packet_no_fast_thread_local
Jun 27, 2018
Merged

normanmaurer merged 1 commit into
4.1from
native_datagram_packet_no_fast_thread_local

Conversation

@normanmaurer

Copy link
Copy Markdown
Member

Motivation:

We can store the NativeDatagramPacketArray directly in the EpollEventLoop. This removes the need of using FastThreadLocal.

Modifications:

  • Store NativeDatagramPacketArray directly in the EpollEventLoop (just as we do with IovArray as well).

Result:

Less FastThreadLocal usage and more consistent code.

@normanmaurer

Copy link
Copy Markdown
Member Author

@jasontedor this is related to #8051 and #8017

@normanmaurer normanmaurer self-assigned this Jun 27, 2018
@normanmaurer normanmaurer added this to the 4.1.26.Final milestone Jun 27, 2018
@normanmaurer
normanmaurer force-pushed the native_datagram_packet_no_fast_thread_local branch from a7ae1e8 to 7613d65 Compare June 27, 2018 08:17
@normanmaurer

Copy link
Copy Markdown
Member Author

Also @johnou

if (outboundBuffer == null) {
break;
}
outboundBuffer.forEachFlushedMessage(array);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where was this done before? Yeah... I don't understand how the code worked before this change; I don't see anything that adds to the NativeDatagramPacketArray.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forEachFlushedMessage does

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done before in the getInstance call

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I understand now.

if (outboundBuffer == null) {
break;
}
outboundBuffer.forEachFlushedMessage(array);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I understand now.

if (Native.IS_SUPPORTING_SENDMMSG && in.size() > 1) {
NativeDatagramPacketArray array = NativeDatagramPacketArray.getInstance(in);
NativeDatagramPacketArray array = ((EpollEventLoop) eventLoop()).cleanDatagramPacketArray();
ChannelOutboundBuffer outboundBuffer = unsafe().outboundBuffer();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use in like before?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because I am stupid .... let me fix this and thanks for the review

Motivation:

We can store the NativeDatagramPacketArray directly in the EpollEventLoop. This removes the need of using FastThreadLocal.

Modifications:

- Store NativeDatagramPacketArray directly in the EpollEventLoop (just as we do with IovArray as well).

Result:

Less FastThreadLocal usage and more consistent code.
@normanmaurer
normanmaurer force-pushed the native_datagram_packet_no_fast_thread_local branch from 7613d65 to d20370d Compare June 27, 2018 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants