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

Panamize KQueue and EPoll selector implementations #22307

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlekseiEfimov
Copy link
Member

@AlekseiEfimov AlekseiEfimov commented Nov 21, 2024

Description of the changes is under construction


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Contributors

  • Darragh Clarke <dclarke@openjdk.org>

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/22307/head:pull/22307
$ git checkout pull/22307

Update a local copy of the PR:
$ git checkout pull/22307
$ git pull https://git.openjdk.org/jdk.git pull/22307/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 22307

View PR using the GUI difftool:
$ git pr show -t 22307

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/22307.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 21, 2024

👋 Welcome back aefimov! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@AlekseiEfimov
Copy link
Member Author

/contributor add dclarke

@openjdk
Copy link

openjdk bot commented Nov 21, 2024

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk
Copy link

openjdk bot commented Nov 21, 2024

@AlekseiEfimov
Contributor Darragh Clarke <dclarke@openjdk.org> successfully added.

@openjdk
Copy link

openjdk bot commented Nov 21, 2024

@AlekseiEfimov The following labels will be automatically applied to this pull request:

  • core-libs
  • nio

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added nio nio-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Nov 21, 2024
try (Arena arena = Arena.ofConfined()) {
MemorySegment epoll_eventMS = arena.allocate(epoll_event.layout());

epoll_event.events(epoll_eventMS, events);
Copy link
Contributor

@minborg minborg Nov 22, 2024

Choose a reason for hiding this comment

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

There is a common pattern here;

  • Create an Arena
  • allocate a segment for errno
  • do stuff
  • depending on the returned int, do other stuff
  • return a value (or throw)

Could we consolidate that logic in a reusable method?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think thats a good idea, I'll look into it

@minborg
Copy link
Contributor

minborg commented Nov 22, 2024

It's so nice to say goodbye to the C files.

* }
*/
@SuppressWarnings("restricted")
public class epoll_data {
Copy link
Contributor

Choose a reason for hiding this comment

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

These classes could be final and have a private constructor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core-libs core-libs-dev@openjdk.org nio nio-dev@openjdk.org
Development

Successfully merging this pull request may close these issues.

3 participants