gi-rust / grust

GObject introspection bindings for the Rust programming language
GNU Lesser General Public License v2.1
37 stars 3 forks source link

Reconsider the ownership/concurrency model #10

Closed mzabaluev closed 10 years ago

mzabaluev commented 10 years ago

The cross-thread call paths are an albatross for code size, performance, and they use a sentinel thread with a statically unpredictable failure mode in case of a deadlock. Reducing to on-stack FFI calls with single-task ownership for all Rust boxes of a GObject seems like a more practical approach.

The battle plan after an IRC discussion with @strcat:

mzabaluev commented 10 years ago

Cross-thread calls are gone. Ref wrappers for most objects are now non-sendable and non-sync. The very few threadsafe types in GLib (the introspection does not give a way to tell which) are refcounted throught SyncRef.

Not closing yet because I want to ensure the object structs themselves are not sendable.