Przemyslaw,

Przemysław Czerpak wrote:
> Such results can be a little bit change by autoinlining when -O3 is used
> so it would be nice if you can also test this function:
> 
>    ULONG _hb_gettid2( void )
>    {
>       ULONG tid = 0;
>       PTIB  ptib = NULL;
> 
>       if( DosGetInfoBlocks( &ptib, NULL ) == NO_ERROR )
>          tid = ptib->tib_ptib2->tib2_ultid;
> 
>       return tid;
>    }
> 

Here it is:

(E:\harbour\test)gettid
Time _hb_gettid() 693
Time _gettid() 1787
Time _hb_gettid2() 2952

> Yes it is and it's good place to store such information but it's not TLS
> area :-)

Ok, but bear in mind that on OS/2 TLS area is a very limited resource:

--------8<---------------
When a process is started, a small block of memory is set aside to be used as
a thread-local memory area. This memory is at the same virtual address for
each thread, but is backed by different physical memory. This permits each
thread to have a small block of memory that is unique, or local, to that thread.

The thread-local memory area consists of 32 DWORDs (128 bytes), each DWORD
being 4 bytes in size. Up to 8 DWORDs (32 bytes) can be requested each time
this function is called. If you want to allocate more than 8 DWORDs, you must
call this function more than once.

Allocation is by DWORD only. If you want to store a BYTE in the thread-local
memory area, you would still allocate a DWORD, then store the BYTE in it.


Best regards.

Maurilio.

-- 
 __________
|  |  | |__| Maurilio Longo
|_|_|_|____| farmaconsult s.r.l.


_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to