All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kang Kai <Kai.Kang@windriver.com>
To: ltp-list@lists.sourceforge.net
Subject: [LTP] Question about priority of pthread rwlock on linux
Date: Fri, 9 Dec 2011 18:01:41 +0800	[thread overview]
Message-ID: <4EE1DC85.3060301@windriver.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1173 bytes --]

Hello everyone,

I am working on Yocto( a kind of  embedded linux) to make POSIX test 
cases pass. It uses kernel 3.0 and eglibc 2.3.

There are 3 failed test cases about pthread rwlock:
pthread_rwlock_rdlock/2-1 pthread_rwlock_rdlock/2-2  
pthread_rwlock_unlock/3-1

In pthread_rwlock_rdlock/2-1,  main thread*read lock* a rwlock,  child 
thread1 *write lock* the rwlock with a medium priority, so it should be 
blocked. child thread2 try to *read lock *the rwlock with low priority, 
the case says child thread2 should block too. But in Yocto linux child 
thread2 doesn't block and then read lock the rwlock, that make test case 
fail.

In eglibc nptl implementation, rwlock has a element "__flags" to 
identify prefer write lock or read lock, default is to prefer read lock. 
If change __flags to prefer write lock, the test case will pass.

My questions are:
1 What is the test case base on? I checked the  POSIX.1-2008 but didn't 
find description priority about the pthread rwlock? Could anyone give me 
a source that make me to understand it better?
2 Which C library or platform can make this case pass? So that I can 
compare it with eglibc.

Thanks a lot!
Kai




[-- Attachment #1.2: Type: text/html, Size: 1588 bytes --]

[-- Attachment #2: Type: text/plain, Size: 384 bytes --]

------------------------------------------------------------------------------
Cloud Services Checklist: Pricing and Packaging Optimization
This white paper is intended to serve as a reference, checklist and point of 
discussion for anyone considering optimizing the pricing and packaging model 
of a cloud services business. Read Now!
http://www.accelacomm.com/jaw/sfnl/114/51491232/

[-- Attachment #3: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

             reply	other threads:[~2011-12-09 10:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-09 10:01 Kang Kai [this message]
2011-12-09 13:15 ` [LTP] Question about priority of pthread rwlock on linux Cyril Hrubis
     [not found]   ` <CAGH67wT1TwR89P+rQpo4gC7Qx0iRFkJbzxVA=PSu0QiC+uDE4g@mail.gmail.com>
2011-12-14 11:49     ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4EE1DC85.3060301@windriver.com \
    --to=kai.kang@windriver.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.