[haiku-bugs] Re: [Haiku] #8798: PTHREAD_RWLOCK_INITIALIZER macro not defined

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sat, 03 Jun 2017 05:28:46 -0000

#8798: PTHREAD_RWLOCK_INITIALIZER macro not defined
----------------------------+----------------------------
   Reporter:  cian          |      Owner:  nobody
       Type:  bug           |     Status:  reopened
   Priority:  normal        |  Milestone:  Unscheduled
  Component:  System/POSIX  |    Version:  R1/Development
 Resolution:                |   Keywords:
 Blocked By:                |   Blocking:
Has a Patch:  1             |   Platform:  All
----------------------------+----------------------------

Comment (by bonefish):

 Replying to [comment:16 korli]:

bonefish, yes readers and writers are treated unfairly in the patch, as
 in the specification: "The calling thread acquires the read lock if a
 writer does not hold the lock and there are no writers blocked on the
 lock.", which actually means that writers can overtake waiting readers.
 
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_rwlock_rdlock.html

 But that only means that a reader may not overtake an already waiting
 writer. In your implementation a new writer also overtakes an already
 waiting reader. While the specification doesn't seem to disallow that
 behavior, it means readers can be starved (which cannot happen with the
 current common queue implementation).

--
Ticket URL: <https://dev.haiku-os.org/ticket/8798#comment:17>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: