harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xiao-Feng Li" <xiaofeng...@gmail.com>
Subject Re: [drlvm][gc] TLS access from GC: a proposal to refactor the code
Date Wed, 25 Oct 2006 08:10:47 GMT
On 10/25/06, Mikhail Fursov <mike.fursov@gmail.com> wrote:
> On 10/25/06, Xiao-Feng Li <xiaofeng.li@gmail.com> wrote:
> >
> > Hi, Mikhail, how about this:
> >
> > In GC thread init:
> > gc_tls_data_ptr = malloc_gc_tls_data(sizeof(GC_Thread_Info) );
> > gc_tls_key = thread_create_tls_key();
> > thread_set_tls_data( gc_tls_key, gc_tls_data_ptr);
> >
> > To fast alloc:
> >
> > gc_tls_data_ptr = thread_get_tls_data( gc_tls_key);
> > free = *(gc_tls_data_ptr + offset_of_free_in_gc_tls);
> >
> > Can't this work? Sounds like I missed something?
> >
> Xiao-Feng,
> Yes we talking about the same functionality.
> The problem with your example is that TM has no such an API :)
>
> The only method we have is 'hythread_tls_alloc (hythread_tls_key_t*
> handle);' and it allocates sizeof(void*) bytes in TLS struct.
> And the method we need is:
> 'hythread_tls_alloc (hythread_tls_key_t* handle, size_t bytes);' or
> 'hythread_tls_alloc (hythread_tls_key_t* handle, size_t numSlots);'  where
> numSlots for GC is  ~ sizeof(GC_Thread_Info)/sizeof (void*)
>

Why do we need multiple slots? Can't we use just one slot, which
stores a pointer to a user data structure (the GC_Thread_Info in this
case)?

Thanks,
xiaofeng

> --
> Mikhail Fursov
>
>

Mime
View raw message