Results 1 to 5 of 5

Thread: how to create kernal thread in system

  1. #1
    Join Date
    May 2009
    Posts
    1,010

    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 .

  2. #2
    Dr. V Guest

    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.

  3. #3
    Join Date
    May 2008
    Posts
    2,680

    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.

  4. #4
    Join Date
    Nov 2005
    Posts
    3,026

    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().

  5. #5
    Join Date
    Apr 2008
    Posts
    3,295

    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.

Similar Threads

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

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,537,840.31658 seconds with 17 queries