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

Implement Send for structs that wrap GDAL types #417

Open
ttencate opened this issue Jun 9, 2023 · 1 comment
Open

Implement Send for structs that wrap GDAL types #417

ttencate opened this issue Jun 9, 2023 · 1 comment

Comments

@ttencate
Copy link
Contributor

ttencate commented Jun 9, 2023

Quoting the documentation:

a C function or C++ method is said to be re-entrant if it can be called simultaneously from multiple threads, but only if each invocation uses its own data.

All GDAL public C functions and C++ methods are re-entrant, except:

Thus, it should be safe to implement Send for all wrapper types. This was already done for Dataset in #99, OwnedLayer in #238 and Error in #293.

The one I'm currently missing is SpatialRef, but there are probably more.

@BlakeOrth
Copy link

Given the discussion in #419 and the discovery of the underlying behavior of some of the reference counted types, it seems like careful consideration needs to be made when marking GDAL struct wrappers as Send. As my #419 (comment) suggests, I've done a decent amount of digging for SpatialRef specifically and I believe with some (API breaking) changes it can safely be marked as Send. I'd be happy to open a PR with those changes if you'd be interested in introducing them.

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

No branches or pull requests

2 participants