Skip to content

Add partial support for future values of LOGICAL_PROCESSOR_RELATIONSHIP#1327

Merged
dbwiddis merged 2 commits intojava-native-access:masterfrom
dbwiddis:logproc
Mar 17, 2021
Merged

Add partial support for future values of LOGICAL_PROCESSOR_RELATIONSHIP#1327
dbwiddis merged 2 commits intojava-native-access:masterfrom
dbwiddis:logproc

Conversation

@dbwiddis
Copy link
Copy Markdown
Contributor

See #1324 for more details.

This PR implements new LOGICAL_PROCESSOR_RELATIONSHIP enum values which are present in current Windows Insider builds and currently throw an IllegalStateException when instantiating a SYSTEM_LOGICAL_PROCESSOR_INFORMATION_EX structure from a pointer.

A complete implementation will require updating the NUMA_NODE_RELATIONSHIP structure and javadocs, and will be submitted later once the new API documentation is available.

@matthiasblaesing
Copy link
Copy Markdown
Member

I admit I have only glanced over, but just a thought - would it make sense to return a generic value holding the raw memory value when an unsupported relationship is encountered? That way people would at least get a value and not blow with an exception - especially as it is now proven, that new relationships are possible. Possible name "UNKNOWN_RELATIONSHIP".

@dbwiddis
Copy link
Copy Markdown
Contributor Author

Possible name "UNKNOWN_RELATIONSHIP".

Heh. I actually had previously implemented a similar workaround with exactly that name and am happy to go that route. My reasoning to not submit it that way was that after the new code was in we'd never use that structure again.

We'll still have the two leading int values for relationship and size; what would you suggest to retrieve the remaining data? I'm thinking no field, but a convenience getter that returns a Pointer sharing the "size" number of bytes of memory.

@dbwiddis
Copy link
Copy Markdown
Contributor Author

Actually such a getter isn't needed, the structure itself already has a getPointer() that returns the same thing.

@matthiasblaesing
Copy link
Copy Markdown
Member

Looks sane to me.

@dbwiddis dbwiddis merged commit 58bc0a0 into java-native-access:master Mar 17, 2021
@dbwiddis dbwiddis deleted the logproc branch March 17, 2021 19:55
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.

2 participants