apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dror Shilo" <Dror.Sh...@ericom.com>
Subject RE: Threads Best Practices
Date Sun, 10 Oct 2004 07:12:53 GMT
> 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
> 
> 1) you can put null
> 2) see apr samples
> 
> void * APR_THREAD_FUNC ThreadProc(apr_thread_t *, void *context)
> {
> }
> 3)	use
> 	apr_os_thread_current()
> 
> 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


Mime
View raw message