smol-rs / futures-lite

Futures, streams, and async I/O combinators.
Apache License 2.0
439 stars 25 forks source link

parking vs std::thread::park #53

Closed james7132 closed 2 years ago

james7132 commented 2 years ago

Is the parking crate strictly necessary when the standard library is available? According to the docs, std::thread::park has been available since 1.0 and looking at it's implementation, it seems very similar in the generic case to parking's. It does seem to have per-platform optimizations too. An equivalent Unparker can be made wrapping a std::thread::Thread using Thread::unpark.

taiki-e commented 2 years ago

Closing per https://github.com/smol-rs/futures-lite/pull/54#issuecomment-1183361388.