For the conceptual part, you can read Robert Love's Linux Kernel Development. The book generally says you can use functions like
struct task_struct * kthread_create (...);
struct task_struct * kthread_run (...);
struct task_struct * kthread_stop (...);
to manage threads. Threads are actually light-weight processes in the kernel. So you would need to do your homework on processes as well, if you haven't done so.
For the consumer-producer problem, here's an example using pthread.
Hope this helps.