Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

Add async packet sending #88

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MelonHell
Copy link

resolves #79
prev pr #82 (I needed to rename the branch)

Not ready yet, sometimes client throws this exception
290830053-fb053b99-398d-44be-a801-c31c5705283b

@mworzala
Copy link

With java 21 we will need to start removing uses of synchronized in most places (it doesn't play well with virtual threads). I do not want to introduce more use cases (it should use a ReentrantLock instead most likely).

I think "async" is somewhat misleading here. It can be used async, but really it is writing immediately (and synchronously) in the current thread. I would prefer some name like writePacketImmediate.

Finally, while I am ok with this change in theory, I am very unclear on the performance detriment of locking on all writes.

@MelonHell MelonHell force-pushed the patch/async-packet-sending branch 3 times, most recently from 1cb15a6 to f40dd71 Compare December 19, 2023 10:53
@MelonHell MelonHell force-pushed the patch/async-packet-sending branch 2 times, most recently from 9b4fe49 to a5b5530 Compare January 2, 2024 12:22
@MelonHell MelonHell force-pushed the patch/async-packet-sending branch from a5b5530 to f117182 Compare January 22, 2024 07:43
sidey383 and others added 5 commits January 26, 2024 13:56
# Conflicts:
#	src/main/java/net/minestom/server/network/player/PlayerSocketConnection.java
# Conflicts:
#	src/main/java/net/minestom/server/network/player/PlayerSocketConnection.java
@MelonHell MelonHell force-pushed the patch/async-packet-sending branch from f117182 to 40e3f6d Compare January 26, 2024 10:56
@MelonHell MelonHell changed the base branch from 1_20_2 to main January 26, 2024 15:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants