thr_create with/without THR_NEW_LWP

thr_create with/without THR_NEW_LWP

Post by Matt Frant » Thu, 14 Oct 1999 04:00:00



I have a server that has two types of threads.  Some persist throughout
the life of the process.  Others are transient.  Currently, I am
creating the transient threads using thr_create with the THR_NEW_LWP and
THR_DETACHED, as the following fragment indicates:

   int err =
      thr_create( NULL, NULL,
    (void*(*)(void*)) launch,
    (void*) this,        // Pass self as argument
    THR_NEW_LWP | // Increase LWP count
    THR_DETACHED, // Free resources on exit (nonjoinable)
    &_id
    );

My concern is whether the LWP count is decremented when the transient
threads die, or whether I am "leaking" some kind of resource.

Are there any caveats about THR_NEW_LWP ?

Currently, the server has reliability problems, but I am thinking that
it is Orbix-related.

Platform: Solaris 2.6
Hardware: Various

Regards,
Matt Frantz
ESDA Development
Micron Technology Texas, LLC

 
 
 

thr_create with/without THR_NEW_LWP

Post by Roger A. Faulkn » Fri, 15 Oct 1999 04:00:00



Quote:>SSBoYXZlIGEgc2VydmVyIHRoYXQgaGFzIHR3byB0eXBlcyBvZiB0aHJlYWRzLiAgU29tZSBw
>ZXJzaXN0IHRocm91Z2hvdXQNCnRoZSBsaWZlIG9mIHRoZSBwcm9jZXNzLiAgT3RoZXJzIGFy
>ZSB0cmFuc2llbnQuICBDdXJyZW50bHksIEkgYW0NCmNyZWF0aW5nIHRoZSB0cmFuc2llbnQg
>dGhyZWFkcyB1c2luZyB0aHJfY3JlYXRlIHdpdGggdGhlIFRIUl9ORVdfTFdQIGFuZA0KVEhS
>X0RFVEFDSEVELCBhcyB0aGUgZm9sbG93aW5nIGZyYWdtZW50IGluZGljYXRlczoNCg0KICAg
>aW50IGVyciA9DQogICAgICB0aHJfY3JlYXRlKCBOVUxMLCBOVUxMLA0KICAgICh2b2lkKigq
>KSh2b2lkKikpIGxhdW5jaCwNCiAgICAodm9pZCopIHRoaXMsICAgICAgICAvLyBQYXNzIHNl
>bGYgYXMgYXJndW1lbnQNCiAgICBUSFJfTkVXX0xXUCB8IC8vIEluY3JlYXNlIExXUCBjb3Vu
>dA0KICAgIFRIUl9ERVRBQ0hFRCwgLy8gRnJlZSByZXNvdXJjZXMgb24gZXhpdCAobm9uam9p
>bmFibGUpDQogICAgJl9pZA0KICAgICk7DQoNCk15IGNvbmNlcm4gaXMgd2hldGhlciB0aGUg
>TFdQIGNvdW50IGlzIGRlY3JlbWVudGVkIHdoZW4gdGhlIHRyYW5zaWVudA0KdGhyZWFkcyBk
>aWUsIG9yIHdoZXRoZXIgSSBhbSAibGVha2luZyIgc29tZSBraW5kIG9mIHJlc291cmNlLg0K
>DQpBcmUgdGhlcmUgYW55IGNhdmVhdHMgYWJvdXQgVEhSX05FV19MV1AgPw0KDQpDdXJyZW50
>bHksIHRoZSBzZXJ2ZXIgaGFzIHJlbGlhYmlsaXR5IHByb2JsZW1zLCBidXQgSSBhbSB0aGlu
>a2luZyB0aGF0DQppdCBpcyBPcmJpeC1yZWxhdGVkLg0KDQpQbGF0Zm9ybTogU29sYXJpcyAy
>LjYNCkhhcmR3YXJlOiBWYXJpb3VzDQoNClJlZ2FyZHMsDQpNYXR0IEZyYW50eg0KRVNEQSBE
>ZXZlbG9wbWVudA0KTWljcm9uIFRlY2hub2xvZ3kgVGV4YXMsIExMQw0KDQo=

Send this again, in ASCII, and I might respond.

Roger Faulkner

 
 
 

1. thr_create with/without THR_NEW_LWP

I have a server that has two types of threads.  Some persist throughout
the life of the process.  Others are transient.  Currently, I am
creating the transient threads using thr_create with the THR_NEW_LWP and
THR_DETACHED, as the following fragment indicates:

   int err =
      thr_create( NULL, NULL,
    (void*(*)(void*)) launch,
    (void*) this,        // Pass self as argument
    THR_NEW_LWP | // Increase LWP count
    THR_DETACHED, // Free resources on exit (nonjoinable)
    &_id
    );

My concern is whether the LWP count is decremented when the transient
threads die, or whether I am "leaking" some kind of resource.

Are there any caveats about THR_NEW_LWP ?

Currently, the server has reliability problems, but I am thinking that
it is Orbix-related.

Platform: Solaris 2.6
Hardware: Various

Regards,
Matt Frantz
ESDA Development
Micron Technology Texas, LLC

2. How do I change FTP port in ftpaccess?

3. problem with thr_create

4. Need drivers (source ) fo Promise FastTrack 376 S150 TXPLus

5. wrong example in thr_create(3T) man page

6. host name and apache

7. fork vs. exec vs thr_create

8. samba + migration win95 -> win98

9. thr_create & THR_DAEMON

10. Stack size in thr_create() on PC's with Sol2.4?

11. Problem with thr_create

12. Hang in fork1() and thr_create()

13. How to kill LWPs created by thr_create?