tech-userlevel archive

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

pthread library related



Hi guys,


   I spent some time on pthread libraries in netbsd which is a big part in
my project, and have some questions to ask.
Taking pthread_barrierattr_getpshared, pthread_barrierattr_setpshared
as an example. These functions  are used to getting and setting barrierattr
data structure. netbsd has several fields in the data structure, while
freebsd has the only pshared field. I am wondering which fields in the
implementation of netbsd can be used as pshare in netbsd?
Following are definitions of netbsd vs freebsd, the same problems exist in
mutexattr, condattr and rwlockattr. Also are there any documents which
describe implementation details in netbsd? It would be great if we have.

   *functions with missing features*:
   pthread_barrierattr_getpshared
   pthread_barrierattr_setpshared
   *netbsd *
   struct __pthread_barrier_st {
          unsigned int  ptb_magic;

          /* Protects data below */
          pthread_spin_t  ptb_lock;

          pthread_queue_t ptb_waiters;
          unsigned int  ptb_initcount;
          unsigned int  ptb_curcount;
          unsigned int  ptb_generation;

          void    *ptb_private;
    };

    *freebsd*
     struct pthread_barrierattr {
         int   pshared;
    };

   *functions with missing features:*
   pthread_mutexattr_setpshared
   pthread_mutexattr_getpshared
   pthread_mutexattr_getprioceiling
   pthread_mutexattr_setprioceiling
   pthread_mutexattr_getprotocol
   pthread_mutexattr_setprotocol

   *netbsd*:
   struct __pthread_mutexattr_st {
      unsigned int  ptma_magic;
      void  *ptma_private;
  };

  *freebsd*:
  struct pthread_mutex_attr {
    enum pthread_mutextype  m_type;
    int     m_protocol;
    int     m_ceiling;
    int     m_pshared;
  };

   *functions with missing features*
   pthread_condattr_setpshared
   pthread_condattr_getpshared
   pthread_condattr_getclock

   *netbsd*
    struct  __pthread_condattr_st {
          unsigned int  ptca_magic;
          void  *ptca_private;
    };
    *freebsd*
    struct pthread_cond_attr {
          int   c_pshared;
          int   c_clockid;
    };

*  functions with missing features*
  pthread_rwlockattr_getpshared
   pthread_rwlockattr_setpshared

   *netbsd*
   struct __pthread_rwlockattr_st {
         unsigned int  ptra_magic;
         void *ptra_private;
    };
    *freebsd*
    struct pthread_rwlockattr {
        int   pshared;
    };


Home | Main Index | Thread Index | Old Index