On Fri, 26 Sep 2008, Randy Portnoff wrote:

Hi Randy,
> Not sure if this was already covered in this thread so I will mention it 
> just in case...
> IMO, work areas need to support both per thread and cross thread 
> capability, on a per work area basis.

Both are already implemented.
Just simply dbRequest() and dbRelease() are obligatory locks for global
WA. Otherwise you will have intermediate WA corruption or unexpected
results when two threads will try to make sth on the same WA, f.e.
one will make skip(1) and the second skip(-1). If you do not see it yet
the you can even define preporcessor commands to make it more clear, f.e.:
   #xcommand WA_LOCK   <(alias)> => dbRequest(<alias>)
   #xcommand WA_UNLOCK <(alias)> => dbRelease(<alias>)
   #command GLOBAL USE [<param,...>] => USE <param>; dbRelease()

If you want to use common for all thread WA you are making:
   WA_LOCK MYTABLE
   [...]
   WA_UNLOCK MYTABLE

> For example, you may have one workarea that needs to be thread-specific 
> while another can be
> shared across all threads - Similar to PUBLIC versus LOCAL variables.
> I could see the PRG syntax looking something like this:
> use MYTABLE.DBF new shared threadsafe  // Current thread only

   use MYTABLE.DBF new shared

> use MYTABLE.DBF new shared  // Can be accessed by all threads

   GLOBAL use MYTABLE.DBF new shared

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

Reply via email to