On Fri, 31 Oct 2008, Pritpal Bedi wrote: Hi Pritpal,
> Now the real issue: > I have built the RDD on back of nWA which needs to be unique > for each table open. Now in MT every thread has common nWAs Each thread has its own poll of WA numbers not common. > and this is breaking my methodology. > Thou I can issue like: > STATIC nWorkArea := 0 > nWorkArea++ > SELECT( nWorkArea ) > USE 'SomeTable' SHARED > This gives me unique workarea for each new table opened, but you > know it has a lot of limitations: > 1) I can exhaust maximum WAs > 2) Workareas cannot be reused once table is closed > 3) MOST IMPORTANT: I have to change the sources whereever a table is opened. > My feature request: > Is it possible that Harbour defines something like: > SET( _SET_WORKAREAS, lUnique ) > and internally nWA is fetched form common pool if NEW clause is included in > USE. It's default behavior. Probably I do not understand what you need. If you want to add unique for all thread number which is you low level table ID into each open WA then simply add it to your RDD local workarea structure and extract it: nTableNO := USRRDD_AREADATA( nWA )[ MYWA_TABLE ] and use it instead of nWA directly. If you want to change the WA numbers allocating in Harbour RDD code so they will be unique between threads then it's rather bad idea. It will force blocking a lot of RDD code because we will need serialization for everything what can allocate/release new WA. Many modifications, bad performance/scalability overhead and new problems to resolve, f.e. RT errors which can stop the thread with locked RDD internals. best regards, Przemek _______________________________________________ Harbour mailing list Harbour@harbour-project.org http://lists.harbour-project.org/mailman/listinfo/harbour