Quantcast
Channel: Active questions tagged kernel - Stack Overflow
Viewing all articles
Browse latest Browse all 6334

How to make sure only one instance of a C kernel module is running (Singleton)?

$
0
0

For my assignment I need to determine suitable design patterns for my kernel module. Since it modifies one critical area of kernel code, I can't allow there to be more than one instance of it running - the modified code could be taken for the original and there'd be no way to restore the system to its initial state on module_exit. With that in mind, I chose the Singleton design pattern, among others. Now I need to actually implement the restriction, which goes along with it - the program needs to guarantee that only one instance of it is active at the time.

Is this common practice for kernel modules? I haven't seen this being discussed. If so, how can I implement the restriction?


Viewing all articles
Browse latest Browse all 6334

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>