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

Experiment with context forking to increase thema concurrency #122

Open
sdboyer opened this issue Mar 21, 2023 · 0 comments
Open

Experiment with context forking to increase thema concurrency #122

sdboyer opened this issue Mar 21, 2023 · 0 comments
Labels
performance prio/mid Medium priority readiness/prod Requisite for achieving production readiness

Comments

@sdboyer
Copy link
Contributor

sdboyer commented Mar 21, 2023

It's known that certain CUE API operations aren't safe for use in multiple goroutines simultaneously, within the same *cue.Context. (This issue itself needs larger-scale treatment than we're looking at here). In #67/ 45ac142 i introduced an internal mutex intended to help with this a bit. That was quite the sledgehammer, as it basically forces most operations within a thema.Runtime through a single mutex.

In looking through the CUE stdlib gocodec package , i noticed that for cases where the resultant cue.Values don't escape the scope of the call/modifications to the context need not be preserved, such as in Validate, they seem to aim at enabling greater concurrency by forking a separate context. We should explore something similar.

Aside, the gocodec package presents a Go interface to CUE that is functionally similar to Thema, but without the formal structures and invariants - it's worth plumbing for some other ideas, though it doesn't look like direct reuse is a good idea, if only because then we'd be doubling mutexes.

@joanlopez joanlopez added prio/mid Medium priority readiness/prod Requisite for achieving production readiness labels Jun 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance prio/mid Medium priority readiness/prod Requisite for achieving production readiness
Projects
None yet
Development

No branches or pull requests

2 participants