[Gllug] 2 quick questions

tet at accucard.com tet at accucard.com
Tue Jun 11 14:22:45 UTC 2002


>What is a Mutex?

A mutually exclusive lock. A good description can be found in
pthread_mutex_init(3):

       A mutex is a MUTual EXclusion device, and  is  useful  for
       protecting  shared data structures from concurrent modifi­
       cations, and implementing critical sections and  monitors.

       A  mutex  has  two possible states: unlocked (not owned by
       any thread), and locked (owned by one thread). A mutex can
       never  be owned by two different threads simultaneously. A
       thread attempting to lock a mutex that is  already  locked
       by  another  thread  is  suspended until the owning thread
       unlocks the mutex first.

I'm guessing you're thinking more of a kernel implementation, but the
same principles apply.

>What happens if a major page fault occurs?

Fun with virtual memory. I'll let others explain it, 'coz they'll
probably do a better job that I will.

Tet

-- 
Gllug mailing list  -  Gllug at linux.co.uk
http://list.ftech.net/mailman/listinfo/gllug




More information about the GLLUG mailing list