# Linux Kernel Module Cheat
The perfect emulation setup to study and develop the <<linux-kernel>> v5.9.2, kernel modules, <<qemu-buildroot-setup,QEMU>>, <<gem5-buildroot-setup,gem5>> and x86_64, ARMv7 and ARMv8 <<userland-assembly,userland>> and <<baremetal-setup,baremetal>> assembly, <<c,ANSI C>>, <<cpp,C++>> and <<posix,POSIX>>. <<gdb>> and <<kgdb>> just work. Powered by <<about-the-qemu-buildroot-setup,Buildroot>> and <<about-the-baremetal-setup,crosstool-NG>>. Highly automated. Thoroughly documented. Automated <<test-this-repo,tests>>.

#### 17.9.1. kthreads

Let’s launch two threads and see if they actually run in parallel:

    insmod kthreads.ko

Source: kernel_modules/kthreads.c

Outcome: two threads count to dmesg from `0` to `9` in parallel.

Each line has output of form:

    <thread_id> <count>

Possible very likely outcome:

    1 0
    2 0
    1 1
    2 1
    1 2
    2 2
    1 3
    2 3

The threads almost always interleaved nicely, thus confirming that they are actually running in parallel.