3 ms·
It says "Glium: Multi-threading... Send + Sync + Context Management (means it can be done)". Can someone explain a bit about this? I'm not familiar with Rust,
by Keyframe 10y ago
It says "Glium: Multi-threading... Send + Sync + Context Management (means it can be done)".
Can someone explain a bit about this? I'm not familiar with Rust, but with C you have to run GL calls from one and the same thread or you're gonna have a bad day.
Bonus question: Anyone that was/is C programmer (not C++) with opinions on Rust?
- vvanders 10y agoThere's more details in the presenter notes: >I won’t get into much detail about threading, but imagine how the OpenGL skynet-state-machine interacts with multiple threads. GLium ensures only a thread-specific OpenGL context is used on any particular thread. >By making everything neither Send nor Sync, it prevents you from using resources created by one thread in another, enforcing OpenGL semantics at compile-time. Basically any type without Send+Sync traits will not work with existing threading APIs(since they require combinations of Send+Sync based on threading semantics) forcing API calls to be done on the right thread.
- Keyframe 10y agoThanks! I was in presentation mode, for some reason, and didn't see the notes.
- deleted 10y ago[deleted]
- arcticbull 10y agoI've written a bunch of C++ (and abhor it) though my primary experiences are with C and Objective-C and Rust is a fantastic language. It definitely has a learning curve, and writing code in Rust takes me a good bit longer than C/ObjC but when I'm done I'm confident I wrote the code I think I wrote* Rust tackles all the things that are hardest about programming: Correctness, threading and memory management, and validates that you've done it right at compile time. Think of it as an extensive suite of compile-time unit tests. Definitely forces you to think differently though. Nice side-benefit is that I learned Swift way, way faster (and IMO more idiomatically) than if I'd gone direct from ObjC->Swift. *: Not that it's right, just that it's what I intended.