4 ms·
For 1: https://users.rust-lang.org/t/conflicting-lifetime/11887 https://users.rust-lang.org/t/conflicting-lifetime/11887 Or any time you want to use thread and
by khc 9y ago
For 1: https://users.rust-lang.org/t/conflicting-lifetime/11887 https://users.rust-lang.org/t/conflicting-lifetime/11887
Or any time you want to use thread and closure. I know I am joining the threads before the references go away but it's not possible to express that. There's scoped threadpools but sometimes it's at a higher level than scope.
2: Can't get the return value for close(). readdir doesn't return the offset. I ended up wrapping libc myself: https://github.com/kahing/catfs/blob/master/src/catfs/rlibc.rs https://github.com/kahing/catfs/blob/master/src/catfs/rlibc....
I guess wrt string, it's extra frustrating because on unix, OsStr is really CStr but I get former (from command line) and often need latter for interacting with libc. Also when you learn Rust you first learn about str and String even though in my case I actually want to avoid them. Admittedly that's probably rare. Having every type duplicated (a ref type and a storage type) also increases the complexity.
- mmstick 9y agoYou should use crossbeam for #1. And as for strings, I wouldn't think of them as duplicate types any more than u32 and &u32 are duplicate types. They are semantically the same. Referencing a boxed type returns the reference type.
- khc 9y agoWhat does crossbeam have to do with #1? I already mentioned scoped thread pools.
- steveklabnik 9y agoThanks! Always interested in learning about pain points.