Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Linux - Kernel This forum is for all discussion relating to the Linux kernel.


  Search this Thread
Old 10-18-2012, 08:56 AM   #1
LQ Newbie
Registered: Sep 2012
Location: Dhaka, Bangladesh
Distribution: CentOS
Posts: 6

Rep: Reputation: Disabled
Smile Multithreaded kernel module and time function in kernel space

For my work I need to write a kernel module that would run in two separate threads. One will enqueue and dequeue data and other will free the queue if no data is enqueued or dequeued for a certain amount of time. But because of being new to kernel module programming I don't know how to write multithreaded kernel module and how to use functions like <time.h> in standard C. I need some help in this regard. Tutorial links will but if anyone can figure me the way out to do these two tasks then it will be best.

Thanks in advance.
Old 10-19-2012, 01:57 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,274

Rep: Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578Reputation: 578
Best source of info for writing any kernel code is:
You should at least glance at every chapter to get an overview of what kernel functions are available.
Chapter 5 will tell you about locking, which you need to do when multiple kthreads can access the same data.
Chapter 7 has info about the time functions.


kernel module, multithreading, timestamp

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to determine that loadable kernel module is multithreaded numan252 Linux - Kernel 1 06-09-2011 07:39 PM
Can a kernel module call the function of another kernel module sceadu Programming 3 05-02-2011 03:22 AM
time function in kernel space Gourab Das Linux - Newbie 1 01-26-2010 03:27 PM
Do we have any chance of calling user space callback function from kernel space? ravishankar.g Linux - Newbie 1 09-22-2009 08:14 PM
How to Measure Time to execute a function in Kernel space barunparichha Linux - Software 4 01-07-2008 12:48 PM

All times are GMT -5. The time now is 09:26 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration