5 ms·
The kernel today has its own complete standard library of data structures and threading primitives for C. In general I find these much more well-designed and pl
by colonwqbang 5y ago
The kernel today has its own complete standard library of data structures and threading primitives for C. In general I find these much more well-designed and pleasant to use than the user-space C standard library. Give me work queues and kfifos over pthreads any time!
Maybe the rust devs can also learn something worthwhile from working with the kernel community.
- klysm 5y agoI think this also aligns with one of the comments in the article that suggests we should pursue a more unified kernel space and user space.
- colonwqbang 5y agoSome constructs from the kernel are maybe not so relevant to use in userspace. Spinlocks are great in the kernel where we can just mask interrupts. Not so fantastic in userspace. Intrusive linked structures are necessary in the kernel since they let us manipulate collections without allocating. But they are also less convenient. Etc. However, I'm sure there are lots of things which could be useful in both places. I have from time to time toyed with the idea of porting the kernel "standard library" API into userspace. Maybe something like that already exists?
- klysm 5y agoI'm not aware of a version of it available in user space, but at least there is a useful subset which could probably be extracted. At the same time though, having two consumers of the API means more thought needs to go into changes.