Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 35511 invoked from network); 26 Oct 2006 07:24:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Oct 2006 07:24:44 -0000 Received: (qmail 64348 invoked by uid 500); 25 Oct 2006 08:11:21 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 64315 invoked by uid 500); 25 Oct 2006 08:11:21 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 64306 invoked by uid 99); 25 Oct 2006 08:11:21 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2006 01:11:21 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of xiaofeng.li@gmail.com designates 64.233.182.187 as permitted sender) Received: from [64.233.182.187] (HELO nf-out-0910.google.com) (64.233.182.187) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Oct 2006 01:11:09 -0700 Received: by nf-out-0910.google.com with SMTP id m18so505221nfc for ; Wed, 25 Oct 2006 01:10:48 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=lujeTz2SrKEVL+a5nPMHEWn89zIiw0iecj/ErqiudQtupRF4tJJ2dEeGHLwWYVnPHo7JTj+EgQlVU9mW/yI/e94jeLJKstl14bokAe8yWL8FtZ7SmdC/0ckrnjd0foYlbc2fjyIMl3tQ3USmtbvojREbtNqC1zJpFnXIZPziVcU= Received: by 10.78.158.11 with SMTP id g11mr397955hue; Wed, 25 Oct 2006 01:10:48 -0700 (PDT) Received: by 10.78.154.18 with HTTP; Wed, 25 Oct 2006 01:10:47 -0700 (PDT) Message-ID: <9623c9a50610250110k4441eadey986ca5b5782f0ef3@mail.gmail.com> Date: Wed, 25 Oct 2006 16:10:47 +0800 From: "Xiao-Feng Li" To: harmony-dev@incubator.apache.org Subject: Re: [drlvm][gc] TLS access from GC: a proposal to refactor the code In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <9623c9a50610241901j5c66fe85s8adc0c8de95ff233@mail.gmail.com> <9623c9a50610242313v21401f9bq8730e212e5b62261@mail.gmail.com> <9623c9a50610250043t5f79502dqab09b92d42b2f86f@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On 10/25/06, Mikhail Fursov wrote: > On 10/25/06, Xiao-Feng Li 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 > >