rust-crates / ergo_sync

making creating and synchronizing threads ergonomic, therefore fun!
http://docs.rs/ergo_sync
Other
5 stars 0 forks source link

May is mentioned in the docs but is not used #5

Open matklad opened 6 years ago

matklad commented 6 years ago

The docs mention the may library, but it isn’t even in Cargo.toml. BTW, may is an unsafe library, so I am not sure if it is a good idea to promote it...

vitiral commented 6 years ago

We do not (currently) provide threading primitives beyond std::thread::spawn

May is mentioned as a library the user might be interested in, that could be used alongside ergo_sync if someone had that use case/need.

vitiral commented 6 years ago

If you think the docs here could be improved, let me know!

matklad commented 6 years ago

Hm, yeah, I’ve skimmed the docs too fast :-) However, I would still advise against promoting may: it may lead to ub if TLS is used, and a lot of stuff in Rust uses or may use TLS.

See https://github.com/Xudong-Huang/may/issues/6 for the context, and the implementation of the go! macro which masks unsafety without providing any kind of guarantees: https://github.com/Xudong-Huang/may/blob/e2312d5871bfea5b1f4a0f89aafa59c7cff880b9/src/macros.rs#L19

Disclaimer: I have not used may, and I am not an expert in coroutines, so I might be embarrassingly wrong here :)

vitiral commented 6 years ago

I did notice that in their docs. I can point it out explicitly in ergo_sync's docs as well. Thanks!