| View previous topic :: View next topic |
| Author |
Message |
tHeDoc Project Maintener

Joined: 21 Apr 2004 Posts: 237 Location: Echirolles, France
|
Posted: Mon May 03, 2004 3:49 pm Post subject: pthread_cond_init |
|
|
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:
- The pthread_cond_init() function initializes the condition variable cond with attributes attr.
- If attr is NULL, the effect is the same as passing the address of a default condition variable attributes object.
- Upon successful initialization, the condition variable is initialized.
- 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.
- If successfull, pthread_cond_init() returns 0.
- Otherwise, it does not return 0.
- The pthread_cond_init() function returns ENOMEM when there is not sufficient memory to initialize the variable.
- The pthread_cond_init() function returns EAGAIN when the system lacks a resource other than memory, to initialize the variable.
- The function does not return EINTR.
_________________ Sebastien Decugis. |
|
| Back to top |
|
 |
tHeDoc Project Maintener

Joined: 21 Apr 2004 Posts: 237 Location: Echirolles, France
|
Posted: Mon May 03, 2004 5:08 pm Post subject: Conformance Status |
|
|
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 |
|
 |
tHeDoc Project Maintener

Joined: 21 Apr 2004 Posts: 237 Location: Echirolles, France
|
Posted: Mon May 03, 2004 5:12 pm Post subject: Stress Status |
|
|
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 |
|
 |
tHeDoc Project Maintener

Joined: 21 Apr 2004 Posts: 237 Location: Echirolles, France
|
Posted: Tue May 04, 2004 8:16 am Post subject: Scalability Status |
|
|
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 |
|
 |
tHeDoc Project Maintener

Joined: 21 Apr 2004 Posts: 237 Location: Echirolles, France
|
Posted: Thu May 27, 2004 4:36 pm Post subject: Conformance tests |
|
|
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:
| 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: |
1648 Time(s) |
_________________ Sebastien Decugis.
Last edited by tHeDoc on Tue Jun 29, 2004 9:28 am; edited 1 time in total |
|
| Back to top |
|
 |
tHeDoc Project Maintener

Joined: 21 Apr 2004 Posts: 237 Location: Echirolles, France
|
Posted: Thu Jun 03, 2004 3:21 pm Post subject: Stress test |
|
|
Stress Test
The following sample will loop on condvar init/use/destroy until it receives SIGUSR1.
| Description: |
| [STRESS] Kill with # kill -USR1 [pid] # to stop the stress test. |
|
 Download |
| Filename: |
stress.c.tar.gz |
| Filesize: |
10.16 KB |
| Downloaded: |
1742 Time(s) |
_________________ Sebastien Decugis. |
|
| Back to top |
|
 |
tHeDoc Project Maintener

Joined: 21 Apr 2004 Posts: 237 Location: Echirolles, France
|
Posted: Thu Jun 10, 2004 1:10 pm Post subject: Scalability test sample |
|
|
Scalability sample
The following test will display the time take by some cond var initializations, with a growing number of initialized condvars.
| Description: |
|
 Download |
| Filename: |
s-c.c.tar.gz |
| Filesize: |
10.42 KB |
| Downloaded: |
1703 Time(s) |
_________________ Sebastien Decugis. |
|
| Back to top |
|
 |
|