Retire the hand MeosThread guard for JMEOS's generated ensureReady - #44
Merged
estebanzimanyi merged 1 commit intoJul 23, 2026
Conversation
JMEOS now generates the per-thread MEOS-init guard: FunctionsGenerator emits GeneratedFunctions.ensureReady() and embeds it at the top of every _meos_ wrapper, so any GeneratedFunctions call initializes the calling thread on its own. Every Spark UDF reaches MEOS only through GeneratedFunctions — the marshalling helpers UdfMarshal.*FromHex delegate to GeneratedFunctions.*_from_hexwkb, and MeosMemory.free uses Unsafe with no MEOS call — so the hand MeosThread guard and the generator's explicit MeosThread.ensureReady() emissions are redundant. Stop emitting MeosThread.ensureReady() and its import, drop the now-obsolete build-failing per-thread-init invariant (JMEOS's generator owns the guard), and delete MeosThread. The handler is JMEOS's recording MeosErrorHandler, which is non-exiting and surfaces a MEOS error as a MeosException through the wrapper's checkError().
estebanzimanyi
force-pushed
the
retire/spark-meosthread-hand-guard
branch
from
July 23, 2026 06:45
4430f88 to
1c16832
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JMEOS generates the per-thread MEOS-init guard:
FunctionsGeneratoremitsGeneratedFunctions.ensureReady()and embeds it at the top of every_meos_wrapper, so anyGeneratedFunctionscall initializes the calling thread on its own.Every Spark UDF reaches MEOS only through
GeneratedFunctions— the marshalling helpersUdfMarshal.*FromHexdelegate toGeneratedFunctions.*_from_hexwkb, andMeosMemory.freeusesUnsafewith no MEOS call — so the handMeosThreadguard and the generator's explicitMeosThread.ensureReady()emissions are redundant.This stops emitting
MeosThread.ensureReady()and its import, drops the now-obsolete build-failing per-thread-init invariant (JMEOS's generator owns the guard), and deletesMeosThread. The handler is JMEOS's recordingMeosErrorHandler, which is non-exiting and surfaces a MEOS error as aMeosExceptionthrough the wrapper'scheckError().This completes the generate-then-retire for MobilitySpark against the single-source guard shipped in JMEOS.