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 SendUniqueCell and corresponding SendUnique trait #371

Merged
merged 2 commits into from Aug 28, 2018

Conversation

Projects
None yet
3 participants
@sdroege
Member

sdroege commented Aug 28, 2018

This allows sending reference counted objects to different threads as
long as only a single reference to the object exists.


See here for an example usage: https://github.com/sdroege/gstreamer-rs/blob/e8db89464ed51148a710d54c9969e076f3aba702/examples/src/bin/pango-cairo.rs

I plan to add this as another "concurrency" mode to gir, and then most of GIO can be Send-able via this. For Pango this is unfortunately not the case as the layout has a reference to the context (and the context to the fontmap) and uses those, so the refcount of the layout itself is not sufficient for sendability.

That is, this needs very careful investigation for enabling on reference counted objects.

sdroege added some commits Aug 27, 2018

Implement SendUniqueCell and corresponding SendUnique trait
This allows sending reference counted objects to different threads as
long as only a single reference to the object exists.
@GuillaumeGomez

This comment has been minimized.

Show comment
Hide comment
@GuillaumeGomez

GuillaumeGomez Aug 28, 2018

Member

Seems good to me! Thanks!

Member

GuillaumeGomez commented Aug 28, 2018

Seems good to me! Thanks!

@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Aug 28, 2018

Member

@EPashkin what do you think?

Member

sdroege commented Aug 28, 2018

@EPashkin what do you think?

@EPashkin

This comment has been minimized.

Show comment
Hide comment
@EPashkin

EPashkin Aug 28, 2018

Member

@sdroege Thanks, 👍

Member

EPashkin commented Aug 28, 2018

@sdroege Thanks, 👍

@GuillaumeGomez GuillaumeGomez merged commit ed73ac0 into gtk-rs:master Aug 28, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@sdroege

This comment has been minimized.

Show comment
Hide comment
@sdroege

sdroege Aug 28, 2018

Member

Ok, now I only need to add things to gir and send a couple of PRs :) Thanks!

Member

sdroege commented Aug 28, 2018

Ok, now I only need to add things to gir and send a couple of PRs :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment