[mkc2008] Thread Creation, Destruction and Synchronization - side effects of task destruction

Torsten Frenzel frenzel at os.inf.tu-dresden.de
Mon Apr 6 11:06:03 CEST 2009


Jan Bierbaum(s3306700 at mail.inf.tu-dresden.de)@2009.04.05 22:15:14 +0200:
> Hi!
> 
> 
> What happens to mappings created by a (thread of a) task that is
> destroyed? Intuitively I'd say they continue to exist and in the mapping
> data base the "parent task inherits the mappings". That sounds a bit
> awkward, so I'll try a picture:
> 
> 
> A --> B ---> C
>          \-> D
> 
> Some thread in task A established a mapping (of some page) to task B.
> Task B did map that page to tasks C and D afterwards. Now we destroy
> task B. Does the MDB look like this afterwards?
> 
> A ---> C
>    \-> D
> 
>
No the mapping will be revoked from C and D. This makes sense because A
doesn't know anything about C and D.
> 
> 
> Another question:
> On slide 32, as a solution to the problem of trying to access an invalid
> thread lock, there's the approach to "Check [the] validity of [any]
> thread lock before every try [to acquire it]". How is this done? How can
> the validity of a lock be checked without actually touching it in memory?
> 

Of course you need to touch the memory. Practically the thread-lock
lives in the TCB. There is a special function called is_tcb_mapped()
that returns the required information. There is a special case in the
page-fault handler to check whether the pagefault came from this
function and if so, set some flag that the function can evaluate
afterwards.

Torsten.




More information about the mkc2008 mailing list