Other Tech Blogs
Links
Referrers
April 2008
Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Search


Powered by
Movable Type 3.34

April 8, 2008

Documenting the undocumented

A quick note regarding Linux "tasks."

In an exchange regarding a race between timer ticks (and updates of task->utime versus task->signal->(somepointer)->utime), Roland McGrath told me that

current->exit_state can go from zero to nonzero only by current running code in the do_exit path. current does not progress on that path while current is inside one update_process_times call.

The key bit of knowledge that I was lacking and that this (when placed with other information I had gained in the extended email exchange) was that a "task" is really a Linux scheduling unit. From the scheduler's perspective, "task" is the same as "thread." The only thing that makes a set of threads into a multithreaded process is that they share a signal_struct (and their memory map, of course, and a several other things that, as Roland says, are implicitly required to be shared when signal_struct is shared). So a "task" can only be executed on a single cpu at any time, it can't be executed on more than one cpu at a time. Therefore if a "task" is executing and is interrupted, the value of "current" at the interrupt will be that task, which is entirely suspended for the duration of the interrupt.

Posted by Frank at April 8, 2008 11:17 AM | TrackBack
Comments
Post a comment









All anonymous comments will be removed.
You don't have to give your name, but you must give a valid email address and/or website.

Remember personal info?







All Rights Reserved