Luro02 / shorthand

A proc-macro to derive getter, setter and mut getter for structs in rust.
Apache License 2.0
6 stars 0 forks source link

multi threading with rayon #8

Open Luro02 opened 4 years ago

Luro02 commented 4 years ago

It might be worth to take advantage of multiple cores, when this macro generates code.

One easy way would be to use rayon as a drop in replacement. For for-loops one could use the synchronization primitives from the standard library.

This should definitely be an optional feature.

Luro02 commented 4 years ago

This is not possible right now, because TokenStream does not implement Send. Internally TokenStream uses an Rc instead of an Arc, but this should change once the compiler supports parallel compilation. https://github.com/rust-lang/rust/issues/59667