[m-rev.] for review: thread-local storage
Julien Fischer
juliensf at cs.mu.OZ.AU
Mon Jul 3 18:12:13 AEST 2006
On Mon, 3 Jul 2006, Peter Wang wrote:
> On saturn, for a program sitting in a tight loop only, asm_jump.par.gc
> is ~6 times faster after this patch. asm_jump.gc is still ~1.4 times
> faster than that.
>
>
> Estimated hours taken: 5
> Branches: main
>
> When possible, make use of the gcc `__thread' extension for introducing
> thread-local variables. Currently we use the POSIX thread facility for storing
> the address of the Mercury engine that is running on the current thread, i.e.
> pthread_getspecific/pthread_setspecific. If gcc global registers are not
> used, then each access of a Mercury register incurs a call to
> `pthread_getspecific'. Using the `__thread' extension is very much faster.
>
> (If gcc global registers are used then the address of the Mercury engine is
> kept in a hardward register.)
>
>
> configure.in:
> Check if compiler has the `__thread' extension.
>
> runtime/mercury_conf.h.in:
> #define MR_TLS if `__thread' can be used.
>
I would prefer MR_THREAD_LOCAL_STORAGE as opposed to MR_TLS.
Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list