On Sun, 02 Nov 2008, Pritpal Bedi wrote:

Hi Pritpal,

> Ho can I generate a unique number given ThreadID() and nWA ?

Why don't you want to store such unique ID in WA structure and
then simply use it?
You are introducing solutions which at beginning creates limitations.
Have you thought what will happen when WA will be accessed by other
thread? What about hb_dbDeatach()/hb_dbRequest()?

> As maximum limit of workareas per thread is 65534, I can safely 
> define macro as 
> #define MYWORKAREA( nWA )   ( ThreadID() * nWA )
> Am I right ?

No. It should be:
   #define MYWORKAREA( nWA )  ( hreadID() * MAX_WA_NUM + nWA )
anyhow as I said it's bad idea.

best regards,
Przemek
_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to