Return-Path: Delivered-To: apmail-apr-dev-archive@www.apache.org Received: (qmail 93370 invoked from network); 10 Oct 2004 07:12:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 10 Oct 2004 07:12:01 -0000 Received: (qmail 5234 invoked by uid 500); 10 Oct 2004 07:12:00 -0000 Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 5171 invoked by uid 500); 10 Oct 2004 07:11:59 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 5156 invoked by uid 99); 10 Oct 2004 07:11:59 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: Threads Best Practices X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Date: Sun, 10 Oct 2004 09:12:53 +0200 Message-ID: <1FB4A6BBAC3AC748AFFA8E9F42A9EFBD337C77@hunt.ericom.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Threads Best Practices Thread-Index: AcSlHRFOfbulyCRSSO6SVKRjl2+x1wACoFBwAB398vACPiQuIA== From: "Dror Shilo" To: "David Barrett" Cc: X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N > Incidentally, will "apr_os_thread_current( )" work on all platforms > (specifically, Linux and Win32)? Am I understanding this correctly to = mean > that the function works on all platforms, but the return value is > platform-specific? I cast it to integer , it is a unique number for the current process Dror -----Original Message----- From: David Barrett [mailto:dbarrett@quinthar.com] Sent: Tuesday, September 28, 2004 11:12 PM To: Dror Shilo Cc: dev@apr.apache.org Subject: RE: Threads Best Practices > -----Original Message----- > From: Dror Shilo [mailto:Dror.Shilo@ericom.com] > Subject: RE: Threads Best Practices >=20 > 1) you can put null > 2) see apr samples >=20 > void * APR_THREAD_FUNC ThreadProc(apr_thread_t *, void *context) > { > } > 3) use > apr_os_thread_current() >=20 > 4) distroy the pool > apr_thread_join is not needed if you now that the thread has ended. > 5) use apr_sleep() Works great. Thanks! Incidentally, will "apr_os_thread_current( )" work on all platforms (specifically, Linux and Win32)? Am I understanding this correctly to = mean that the function works on all platforms, but the return value is platform-specific? -david