Reactive Extensions in Kernel

Does it possible to use RxCpp in my driver? I try to implement it and have some interesting problems during compilation.
Example:

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cstring:79:9: No member named 'strcoll' in the global namespace

I also tried to implement it in simple console cpp app (Xcode template) – it worked fine, but after checking Kernel Development Mode (-mkernel for clang) I got error about impossible using try/throw...

Accepted Reply

Porting the code for use in the kernel is going to be difficult. The kernel (or IOKit to be precise) uses a restricted subset of C++. Exceptions, multiple inheritance, templates and runtime type information (RTTI) are all disallowed. See Apple's "IOKit Fundamentals" document for information on these and other restriction you will face. A question you need to ask yourself is how much of your work actually needs to be done in the kernel. The general rule is to do the absolute minimum possible in the kernel since it is such a restricted environment.

Replies

Porting the code for use in the kernel is going to be difficult. The kernel (or IOKit to be precise) uses a restricted subset of C++. Exceptions, multiple inheritance, templates and runtime type information (RTTI) are all disallowed. See Apple's "IOKit Fundamentals" document for information on these and other restriction you will face. A question you need to ask yourself is how much of your work actually needs to be done in the kernel. The general rule is to do the absolute minimum possible in the kernel since it is such a restricted environment.