Michael Mulcahy schrieb:
> 
> > so what if I have a thread 10 which is a EMI/UCP process and
> > suddendly a new process gets added with 1034? we have a new conflict...
> 
> No, that what I thought as well, but the gwthread-pthread.c takes
> care of that problem.
> 
> see gwthread-pthread.c
> 
>     /* Find a free table entry and claim it. */
>     first_try = next_threadnumber;
>     do {
>         ti->number = next_threadnumber++;
>         /* Check if we looped all the way around the thread table. */
>         if (ti->number == first_try + THREADTABLE_SIZE) {
>             panic(0, "Cannot have more than %d active threads",
>                   THREADTABLE_SIZE);
>         }
>     } while (THREAD(ti->number) != NULL);
>     THREAD(ti->number) = ti;
> 
>     active_threads++;
> 
> where THREAD(t) is:
> #define THREAD(t) (threadtable[(t) % THREADTABLE_SIZE])
> 
> The thread number is incremented and the mod 1024 position in
> array is checked to see if an entry exists. If an entry exists then
> the thread number is incremented again.

ok, once again I'll chance my opinion ;))

Andreas, do you agree that a (gwthread_self() % THREADTABLE_SIZE)
gives us a runtime unque ID of the thread?

Stipe

[EMAIL PROTECTED]
-------------------------------------------------------------------
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
-------------------------------------------------------------------
wapme.net - wherever you are

Reply via email to