RE: Introduction to kernel threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> Thank you very much for a quick and good reply.

Uhum, we must be missing something here. Could you or the one who
replied to you Cc: his/her answer to kernelnewbies list too?

I was the one who sent the first email, and then Vinit replied to both me
and the list :)

>However, I guess I should
> have been more precise in my initial email. I have gotten very simple
> threads running, but am having difficulties finding information about more
> specific things. For example synchronization, why the kernel has to be
> locked when a new thread is initialized

Has to be locked? Hm, never knew about this requirement. Perhaps it's
not the kernel thread itself that needs to be synchronized, but it is
requirement from the design i.e data structure initialization must be
in atomic operation?

This makes sense, I guess it just did not think things through properly. I
guess it is the same as in user space threads, where you want to initialize
data structures before the thread is allowed to run.

>and what is the preferred way of
> stopping threads. I see some people use signals, while other use the
> kthread_stop.

IIRC, nowadays kthread_stop() is preferred method. However, IIRC too,
before you do that, make sure you do the proper cleanup e.g free the
linked list you have created during kernel thread lifetime, stop and
destroy workqueues you might created, release any locks you might grab
etc.

Ok, thank you for letting me know. Now I have some new keywords to look up
as well :)

-Kristian


--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux