nptl.BullOpenSource.Org Forum Index nptl.BullOpenSource.Org
NPTL Tests & Trace project. Homepage.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

pthread_cond_init

 
Post new topic   Reply to topic    nptl.BullOpenSource.Org Forum Index -> Tests - Conditionnal variables related functions
View previous topic :: View next topic  
Author Message
tHeDoc
Project Maintener


Joined: 21 Apr 2004
Posts: 237
Location: Echirolles, France

PostPosted: Mon May 03, 2004 3:49 pm    Post subject: pthread_cond_init Reply with quote

POSIX

POSIX is a registered trademark from the IEEE. The following assertions are derived from copyrighted material. Original text and copyright information can be found at http://www.opengroup.org.

Here is what POSIX requires for this function:

  1. The pthread_cond_init() function initializes the condition variable cond with attributes attr.
  2. If attr is NULL, the effect is the same as passing the address of a default condition variable attributes object.
  3. Upon successful initialization, the condition variable is initialized.
  4. The macro PTHREAD_COND_INITIALIZER can be used to initialize a default condition variables that is statically allocated. The effect are equivalent initialize the condition variable by a call to pthread_cond_init() with parameter attr specified as NULL, except that no error checks are performed.
  5. If successfull, pthread_cond_init() returns 0.
  6. Otherwise, it does not return 0.
  7. The pthread_cond_init() function returns ENOMEM when there is not sufficient memory to initialize the variable.
  8. The pthread_cond_init() function returns EAGAIN when the system lacks a resource other than memory, to initialize the variable.
  9. The function does not return EINTR.

_________________
Sebastien Decugis.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tHeDoc
Project Maintener


Joined: 21 Apr 2004
Posts: 237
Location: Echirolles, France

PostPosted: Mon May 03, 2004 5:08 pm    Post subject: Conformance Status Reply with quote

Conformance Status


  • Assertion 1 cannot be tested directly. The feature is nevertheless tested every time a condition variable is used. This assertion does not need more testing.
  • Assertion 2 is claimed to be tested in the PTS, but the behavior is not tested. A new test is needed here.
  • Assertion 3 has the same status as assertion 1.
  • Assertion 4 is claimed to be tested in PTS but only compilation issue is tested. A new test is needed here.
  • Assertion 5 cannot be tested. (how/what's the point in testing that when the function fails, the cond var is really uninitialized?)
  • Assertion 6 has the same status as assertion 1: conformance to this assertion will be checked when the cond var is used.
  • Assertion 7 is not currently tested. A test sample will be written here.
  • Assertion 8 is not currently tested. An analysis on what resources the function can need is required.
  • Assertion 9 is not tested yet. A test sample will be written here.


*Update*: Jun 03, 2004
All theses tests are now written. Assertion 8 has no test at this time, as the NPTL implementation does not need any other specific resource. See below for more informations.

_________________
Sebastien Decugis.


Last edited by tHeDoc on Thu Jun 03, 2004 3:31 pm; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tHeDoc
Project Maintener


Joined: 21 Apr 2004
Posts: 237
Location: Echirolles, France

PostPosted: Mon May 03, 2004 5:12 pm    Post subject: Stress Status Reply with quote

Stress Status

The limits issues will be covered in the assertions 7 and 8 conformance tests.

A stress sample looping on conditional variables creations and destructions with different attributes has to be written to ensure the function does not leak memory.

*Update*: Jun 03, 2004
This sample is now written. See below for more information.

_________________
Sebastien Decugis.


Last edited by tHeDoc on Thu Jun 03, 2004 3:36 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tHeDoc
Project Maintener


Joined: 21 Apr 2004
Posts: 237
Location: Echirolles, France

PostPosted: Tue May 04, 2004 8:16 am    Post subject: Scalability Status Reply with quote

Scalability Status

There is currently no sample test concerning the scalability issues in this function. As pthread_cond_init() might allocate some resources, one could think such a sample has a meaning. A sample will be written to test the maximum number of condition variables that can be initialized (the memory limitation will not be our concern here) and whether the initialization duration is dependent on the number of condition variables already initialized.

_________________
Sebastien Decugis.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tHeDoc
Project Maintener


Joined: 21 Apr 2004
Posts: 237
Location: Echirolles, France

PostPosted: Thu May 27, 2004 4:36 pm    Post subject: Conformance tests Reply with quote

Conformance tests

NOTE: the testfrmw.* files have been updated too (backward compatible)

Both tests for assertion 2 are not 100% OK:
-> 1.2 will imply a small decay in the system clock, each time it runs.
-> 1.3 uses undefined behavior. It might segfault on some implentations for example. On linux/nptl, it fails ~ 1 time over 10 and passes the other 9.


* Update * Jun 29, 2004

The following tests are now included in PTS:



1-3.c.tar.gz
 Description:
If attr is NULL, the effect is the same as passing the address of a default condition variable attributes object - PSHARED Issue

Download
 Filename:  1-3.c.tar.gz
 Filesize:  13.81 KB
 Downloaded:  1644 Time(s)


_________________
Sebastien Decugis.


Last edited by tHeDoc on Tue Jun 29, 2004 9:28 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tHeDoc
Project Maintener


Joined: 21 Apr 2004
Posts: 237
Location: Echirolles, France

PostPosted: Thu Jun 03, 2004 3:21 pm    Post subject: Stress test Reply with quote

Stress Test

The following sample will loop on condvar init/use/destroy until it receives SIGUSR1.



stress.c.tar.gz
 Description:
[STRESS] Kill with # kill -USR1 [pid] # to stop the stress test.

Download
 Filename:  stress.c.tar.gz
 Filesize:  10.16 KB
 Downloaded:  1739 Time(s)


_________________
Sebastien Decugis.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tHeDoc
Project Maintener


Joined: 21 Apr 2004
Posts: 237
Location: Echirolles, France

PostPosted: Thu Jun 10, 2004 1:10 pm    Post subject: Scalability test sample Reply with quote

Scalability sample

The following test will display the time take by some cond var initializations, with a growing number of initialized condvars.



s-c.c.tar.gz
 Description:
[scalability]

Download
 Filename:  s-c.c.tar.gz
 Filesize:  10.42 KB
 Downloaded:  1700 Time(s)


_________________
Sebastien Decugis.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    nptl.BullOpenSource.Org Forum Index -> Tests - Conditionnal variables related functions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group