Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Apr 2003 21:02:56 -0700 (PDT)
From:      Daniel Eischen <deischen@FreeBSD.org>
To:        src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src/lib/libpthread Makefile src/lib/libpthread/thread thr_cond.c thr_create.c thr_kern.c thr_private.h thr_setschedparam.c thr_suspend_np.c
Message-ID:  <200304210402.h3L42u8j046146@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
deischen    2003/04/20 21:02:56 PDT

  FreeBSD src repository

  Modified files:
    lib/libpthread       Makefile 
    lib/libpthread/thread thr_cond.c thr_create.c thr_kern.c 
                          thr_private.h thr_setschedparam.c 
                          thr_suspend_np.c 
  Log:
  Add an i386-specifc hack to always set %gs.  There still seems
  to be instances where the kernel doesn't  properly save and/or
  restore it.
  
  Use noupcall and nocompleted flags in the KSE mailbox.  These
  require kernel changes to work which will be committed sometime
  later.  Things still work without the changes.
  
  Remove the general kse entry function and use two different
  functions -- one for scope system threads and one for scope
  process threads.  The scope system function is not yet enabled
  and we use the same function for all threads at the moment.
  
  Keep a copy of the KSE stack for the case that a KSE runs
  a scope system thread and uses the same stack as the thread
  (no upcalls are generated, so a separate stack isn't needed).
  This isn't enabled yet.
  
  Use a separate field for the KSE waiting flag.  It isn't
  correct to use the mailbox flags field.
  
  The following fixes were provided by David Xu:
  
    o Initialize condition variable locks with thread versions
      of the low-level locking functions instead of the kse versions.
  
    o Enable threading before creating the first thread instead
      of after.
  
    o Don't enter critical regions when trying to malloc/free
      or call functions that malloc/free.
  
    o Take the scheduling lock when inheriting thread attributes.
  
    o Check the attribute's stack pointer instead of the
      attributes stack size for null when allocating a
      thread's stack.
  
    o Add a kseg reinit function so we don't have to destroy and
      then recreate the same lock.
  
    o Check the return value of kse_create() and return an
      appropriate error if it fails.
  
    o Don't forget to destroy a thread's locks when freeing it.
  
    o Examine the correct flags word for checking to see if
      a thread is in a synchronization queue.
  
  Things should now work on an SMP kernel.
  
  Revision  Changes    Path
  1.39      +6 -1      src/lib/libpthread/Makefile
  1.36      +1 -1      src/lib/libpthread/thread/thr_cond.c
  1.40      +39 -15    src/lib/libpthread/thread/thr_create.c
  1.55      +231 -155  src/lib/libpthread/thread/thr_kern.c
  1.81      +6 -7      src/lib/libpthread/thread/thr_private.h
  1.13      +1 -1      src/lib/libpthread/thread/thr_setschedparam.c
  1.18      +6 -3      src/lib/libpthread/thread/thr_suspend_np.c



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304210402.h3L42u8j046146>