harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Ellison <t.p.elli...@gmail.com>
Subject Re: [portlib] hythread_detach limitation
Date Thu, 21 Jun 2007 22:05:00 GMT
Angela Lin wrote:
> I suspect there was an attempt to cut down on calls to
> pthread_getspecific() because it was showing up hot in some
> benchmarks.  Now, I don't know if detach() itself was also hot, but,
> in our usage, we frequently already had the hythread_t available so it
> probably seemed like a good idea to pass it in and circumvent the
> gratuitous lookup.

So how about a comment like this...

/**
 * Detaches the current thread from the threading library.
 *
 * Detach must only be called by an attached thread.  The actual parameter
 * must be the the current thread's hythread_t, or NULL (in which case this
 * function retrieves and uses the current thread's hythread_t).  This
 * function cannot be used to detach an arbitrary thread.
 *
 * When detached, internal resources associated with the thread are freed.
 *
 * @param[in] thread
 *            the hythread_t of the current thread to be detached, or NULL
 *            meaning the current thread struct is looked-up and detached.
 * @return none
 *
 * @see hythread_attach
 */

Regards,
Tim


Mime
View raw message