Go Back   TechArena Community > Software > Operating Systems
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 24-01-2010
Member
 
Join Date: May 2009
Posts: 999
how to create kernal thread in system

hi
i have just purchased a computer. I have installed Linux operating system in my computer.Actually i want to know about kernel thread in brief. How to create & stop that kernel thread in my system.Is that necessary to install it in my system. what is this exactly, please tell me about that .
Reply With Quote
  #2  
Old 24-01-2010
Dr. V
 
Posts: n/a
Re: how to create kernal thread in system

You are using Linux operating system in your pc.The kernel is a central component of operating system.It's work like a bridge.This type of bridge situated between application & actual data process at hardware level.The main function of kernel which is maintain communication between hardware & software part.When init_module() running on process that time five kernel thread are created.This type of kernel thread sleep one second,it also wake up,print a message & fall a sleep again & when we cleanup_module that time kernel thread are killed.If you want new thread that time start_kernel thread or start_kthread in running process then new thread will create.The whole function block untill the thread started. when we want stop the thread then stop_kthread.For the thread termination we need to called exit_kthread.
Reply With Quote
  #3  
Old 24-01-2010
Member
 
Join Date: May 2008
Posts: 2,676
Re: how to create kernal thread in system

When you want create & stop new thread that time you want to firstly called start_kthread.In start_kthread process create a new kernal thread.It can not called from any interrupt but it can call from any process context.The whole function blocks until the thread started.The thread inherit properties from its parents.Make sure we do not get any weir ed properties.The new thread is created with start_kthread().the other function block until the new thread is running .A down () block the start_kthread() routine until the corresponding up()call in init-kthread() is executed same as a up() block the start_kthread() routine until the corresponding down() call in init_kthread()is executed.In kernel thread , the stop_kthread() set a flag that the thread uses to determinate whether do stop or not .stop_kthread() which is shows the signal that is thread to be woken up.
Reply With Quote
  #4  
Old 24-01-2010
Member
 
Join Date: Nov 2005
Posts: 3,023
Re: how to create kernal thread in system

Using new mechanism,the first step which is create a kernel thread to define thread function which has contain the code to be executed like int thread_function().The kernel thread created with struct task _struct*kthread_create(void*data).After that data argument will simply be passed to the the thread function.After completed the create process,if you want to exit or stop the process then you call do_exit() or kthread_stop().because once started the thread, it will run until call do_exit() or somebody call kthread_stop() .for the termination process you can call like exit_kthread().
Reply With Quote
  #5  
Old 24-01-2010
Member
 
Join Date: Apr 2008
Posts: 3,291
Re: how to create kernal thread in system

A kernal thread is a process which is represent entire running program,basically the kernal thread is a fraction of that running program.Thread is a sequence of instruction of executed program.We also say that kernal thread work like bridge because kernal thread exist within the context of a process & provide the operating system. A new thread is created with kernal_thread().Firstly call the start process,then after new thread if you want stop that particular thread then call the stop process . because of calling the init function we can set the environment of new thread.Exit process provide you termination facility.
Reply With Quote
Reply

  TechArena Community > Software > Operating Systems
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "how to create kernal thread in system"
Thread Thread Starter Forum Replies Last Post
MAC OSX - Kernal trap error + Hardware test code stumidd Operating Systems 3 14-01-2014 09:42 AM
How to create system recovery image in Linux system Vedavrata Operating Systems 9 01-08-2012 02:15 PM
Tips to create an RSS Feed from a Forum Thread ChrisUlrich Tips & Tweaks 2 28-02-2012 12:37 PM
Synchronize a producer thread and a consumer thread in C# Ayuka Software Development 6 10-11-2010 04:04 AM
Kernal Task problem reappeared with 10.6.4 update Jitisha Portable Devices 5 26-10-2010 12:04 PM


All times are GMT +5.5. The time now is 05:18 PM.