[dba-VB] c# lock()

Shamil Salakhetdinov shamil at smsconsulting.spb.ru
Mon Mar 28 17:39:57 CDT 2011


Hi John --

<<<
It was this flag class which I was discussing the end of last week. 
It will be accessed by at least two threads so it needs to be thread safe.
>>>
Yes, I see - I do wish it worked efficiently there real soon...

Thank you.

--
Shamil
 
-----Original Message-----
From: dba-vb-bounces at databaseadvisors.com
[mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
Sent: 28 ????? 2011 ?. 7:21
To: Discussion concerning Visual Basic and related programming issues.
Subject: Re: [dba-VB] c# lock()

OK, so I have explained the process.  As you can see I am using threads
pretty heavily.  In general only one thread writes to any given flag field
in a class and in general only one (other) thread reads from that flag.
However threads are peeking at flags all the time "checking" whether the
chunk (in particular) is ready to proceed to the next stage.

This weekend I decided to try a dedicated flag class.  My idea is simply
that each flag represents a field in a table.  Each flag represents a
specific data element from a specific record.  It is only written once
(generally) but potentially read  often.  If I build a dedicated flag class
it can be initialized with the table / field / pkid etc for its specific
field / record and then when the thread writes the flag, the flag class can
write its value out to the right field / record table. 
Again it is normally only ever written once.  Most of my flags are a date /
time that the process step occurred.

So I am trying to wrap the whole flag concept into a class to allow me to
process (read / write /
test) flags in an identical way in all of my process classes.

It was this flag class which I was discussing the end of last week.  It will
be accessed by at least two threads so it needs to be thread safe.

John W. Colby
www.ColbyConsulting.com

On 3/27/2011 8:08 PM, Shamil Salakhetdinov wrote:
> Hi John --
>
> Yes, I see: you tend to build a multi-threaded application/utility 
> system with centralized control - and I tend to build an anarchical 
> free-market model based application/utility system :)
>
> Thank you.
>
> --
> Shamil
_______________________________________________
dba-VB mailing list
dba-VB at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-vb
http://www.databaseadvisors.com




More information about the dba-VB mailing list