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

Thread for transformations like reproject, simplify, etc #24

Merged
merged 5 commits into from
Nov 2, 2023
Merged

Conversation

rafaqz
Copy link
Member

@rafaqz rafaqz commented Oct 26, 2023

Add optional threading to everything that uses apply.

Threaded tasks will be used at the outermost level of the object passed in, over a vector of geometries, features in a feature collection, or e.g. polygons in a multipolygon.

See #23

@rafaqz rafaqz requested a review from skygering October 27, 2023 21:26
@skygering
Copy link
Collaborator

Why are we using a keyword for threaded rather than just making it multithreaded if there is more than one thread available? Is this common practice and will users expect this? Other than that, looks great!

@rafaqz
Copy link
Member Author

rafaqz commented Nov 1, 2023

A few reasons.

We dont actually know how many threads are available any more, because threading can be nested.

If this is running in an already threaded context it may be better to avoid further threading.

But actually, the main reason I added the keyword is because our own code is nested (think a vector of feature collections of multipolygons) and we dont want to keep triggering threading at every level, just the outer one.

Then if we need the keyword anyway for internal use we may as well let users choose as well.

@skygering
Copy link
Collaborator

That makes sense to me! Thanks for explaining. Happy to see it merged.

@rafaqz
Copy link
Member Author

rafaqz commented Nov 1, 2023

No worries! I also might leave false as the default for now in case there are any threading related bugs. That could make debugging other things harder while we build things out.

@rafaqz rafaqz merged commit 049c151 into main Nov 2, 2023
3 checks passed
@asinghvi17 asinghvi17 deleted the threading branch March 31, 2024 22:50
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