|
|
Log in / Subscribe / Register

McKenney: So You Want to Rust the Linux Kernel?

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 4, 2021 9:37 UTC (Mon) by ibukanov (subscriber, #3942)
In reply to: McKenney: So You Want to Rust the Linux Kernel? by scientes
Parent article: McKenney: So You Want to Rust the Linux Kernel?

The channels in Go or communicating serial processes (CSP) as they were called in the original paper by Tony Hoare are problematic for performance. Ada initially relied exclusively on them, but quickly gained mutexes when it was realised in eighties that the hope that the compiler could optimise CSP patterns was way too optimistic. Almost 40 years later situation has not changed much. Even in Go if one wants to max the performance one better use mutexes or other low-level synchronisation methods. So channels are just not suitable for kernel.

And even when performance is not critical channels at least as implemented in Go have numerous problems. Proper cancelation is hard. Priority message delivery is not supported. From anecdotal experience even in Go using single untyped message queue per goroutine modelling what Erlang leads to more maintainable code than using multiple typed channels and select.


to post comments

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 5, 2021 15:16 UTC (Tue) by sytoka (guest, #38525) [Link] (1 responses)

And concerning Erlang, it is also a message-based communication model and the Erlang language has been used by Ericson routers for a long time?

McKenney: So You Want to Rust the Linux Kernel?

Posted Oct 5, 2021 19:52 UTC (Tue) by ibukanov (subscriber, #3942) [Link]

Message passing as implement in Erlang is very different from Go CSP. Each Erlang thread has single message queue associated with it. There is no notion of multiple channel or select statements. Erlang supports message priorities. This architecture is similar to message passing API in various OS and runtimes. They are known to work. CSP on other hand has been known to be problematic for ages.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds