From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from sog-mx-4.v43.ch3.sourceforge.com ([172.29.43.194] helo=mx.sourceforge.net) by sfs-ml-3.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1V2dPw-00071E-KR for ltp-list@lists.sourceforge.net; Fri, 26 Jul 2013 08:30:28 +0000 Received: from [222.73.24.84] (helo=song.cn.fujitsu.com) by sog-mx-4.v43.ch3.sourceforge.com with esmtp (Exim 4.76) id 1V2dPv-0001DH-2d for ltp-list@lists.sourceforge.net; Fri, 26 Jul 2013 08:30:28 +0000 Message-ID: <51F233B4.2030804@cn.fujitsu.com> Date: Fri, 26 Jul 2013 16:30:44 +0800 From: Wanlong Gao MIME-Version: 1.0 References: <1374807380-20319-1-git-send-email-gaowanlong@cn.fujitsu.com> <221551028.6361858.1374822441673.JavaMail.root@redhat.com> <51F22AB9.6060109@cn.fujitsu.com> <1515555986.6425405.1374827280068.JavaMail.root@redhat.com> In-Reply-To: <1515555986.6425405.1374827280068.JavaMail.root@redhat.com> Subject: Re: [LTP] [PATCH 1/3] pthread_rwlock_rdlock:2-1: do not test on glibc Reply-To: gaowanlong@cn.fujitsu.com List-Id: Linux Test Project General Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ltp-list-bounces@lists.sourceforge.net To: Jan Stancek Cc: LTP On 07/26/2013 04:28 PM, Jan Stancek wrote: > > > ----- Original Message ----- >> From: "Wanlong Gao" >> To: "Jan Stancek" >> Cc: "LTP" >> Sent: Friday, 26 July, 2013 9:52:25 AM >> Subject: Re: [PATCH 1/3] pthread_rwlock_rdlock:2-1: do not test on glibc >> >> On 07/26/2013 03:07 PM, Jan Stancek wrote: >>> >>> >>> ----- Original Message ----- >>>> From: "Wanlong Gao" >>>> To: "LTP" >>>> Cc: "Cyril Hrubis" , "Caspar Zhang" >>>> , "Garrett Cooper" , >>>> "Mike Frysinger" , jstancek@redhat.com, "Wanlong Gao" >>>> >>>> Sent: Friday, 26 July, 2013 4:56:18 AM >>>> Subject: [PATCH 1/3] pthread_rwlock_rdlock:2-1: do not test on glibc >>>> >>>> Since the reader can always acquire the rwlock if there's not a writer >>>> held the lock. >>>> >>>> Signed-off-by: Wanlong Gao >>> >>> Hi, >>> >>> I agree that these 3 fail by default on glibc at the moment. >>> Since we are adding a GLIBC ifdef, I'm wondering if we could use >>> glibc specific api to change default behaviour with >>> pthread_rwlockattr_setkind_np() and still run the testcase. >> >> The first 2 *_rdlock cases can change to WRITER_PREFER to let them pass, >> but the last *_unlock one can't, because *_unlock will choose the writer >> first without any care of the NP KIND. >> How about change the first two cases to WRITER_PREFER and just skip the third >> *_unlock one? > > I agree with skipping third one and let's see what other guys think about first two. > When you say "WRITER_PREFER", is that an actual define on your system? Or just > a shortcut for PTHREAD_RWLOCK_PREFER_WRITER...? Surly means shortcut in glibc: 113 enum 114 { 115 PTHREAD_RWLOCK_PREFER_READER_NP, 116 PTHREAD_RWLOCK_PREFER_WRITER_NP, 117 PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 118 PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP 119 }; Thanks, Wanlong Gao > > Regards, > Jan > >> >> Thanks, >> Wanlong Gao >> >>> >>> Regards, >>> Jan >>> >>>> --- >>>> .../conformance/interfaces/pthread_rwlock_rdlock/2-1.c | 6 >>>> ++++++ >>>> 1 file changed, 6 insertions(+) >>>> >>>> diff --git >>>> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c >>>> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c >>>> index c6c1412..62a4b3b 100644 >>>> --- >>>> a/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c >>>> +++ >>>> b/testcases/open_posix_testsuite/conformance/interfaces/pthread_rwlock_rdlock/2-1.c >>>> @@ -141,6 +141,12 @@ int main(void) >>>> return PTS_UNSUPPORTED; >>>> #endif >>>> >>>> +#ifdef __GLIBC__ >>>> + printf("The reader can always acquire rwlock if there's" >>>> + " not a writer held this lock in glibc\n"); >>>> + return PTS_UNTESTED; >>>> +#endif >>>> + >>>> int cnt = 0; >>>> pthread_t rd_thread, wr_thread; >>>> int priority; >>>> -- >>>> 1.8.3.3.754.g9c3c367 >>>> >>>> >>> >> >> > ------------------------------------------------------------------------------ See everything from the browser to the database with AppDynamics Get end-to-end visibility with application monitoring from AppDynamics Isolate bottlenecks and diagnose root cause in seconds. Start your free trial of AppDynamics Pro today! http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list