[Help] Concurency and notification issue

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Chris Voon (Voon_at_discussions.microsoft.com)
Date: 09/11/04


Date: Sat, 11 Sep 2004 08:19:02 -0700

Hi all the experts out there.
 
I have a question that I've been wondering for quite a while.
I have a table that stores the status of a particular case. The status will
change when someone requires it for editing and hence its status will change
to indicate no other ppl may alter it. For that, I have two problems here.
 
1) One is to effectively lock the case by changing some flag value to
indicate it's being used. I'm relying on transactional update on the field
and anyone who attempt to edit it thereafter will check the flag and will
fail if the flag shows non editable.
 
2) I would also like to have all the remote clients be able to tell in real
time the status has changed and update their UI accordingly to reflect status
change.
I understand that this seems like an Observer pattern kind of problem which
was mentioned by this great article from Rocky
(http://msdn.microsoft.com/vbasic/using/columns/adventures/default.aspx?pull=/library/en-us/dnadvnet/html/vbnet06082004.asp).
Love that very much. But I have a concern that my BO is hosted by ASP.NET and
as mentioned in that article, ASP.NET is unpredictable in the resetting and I
might need to store my state out process or even in SQL Server which could be
tedious.
 
I've also looked into SQL Server Notification Services which is very
powerful. Not sure if this will be useful in this case.
 
The simplest solution that I have is to poll from client every couple
seconds to get the latest information. Though the volume for my app is not
high (somewhere 50 concurrent running apps), this solution seems very naive
to me.
 
I'll need to use some load balancer and hence wishing to make the
application stateless.

Wonder if any expert can enlighten me here? Thanks in advance.



Relevant Pages

  • Re: thread synchronization of flag
    ... Why do you need interlocked rmw instructions on an architecture with atomic loads and stores? ... One could simple set the flag with a simple store, and read the flags with a simple load. ... No membars are needed if there is no dependant state. ...
    (comp.programming.threads)
  • Re: Ot sentences that are hard to say was Re: Goodbye -
    ... "Amber" wrote. ... and white, like our flag ... but no red currants are in the stores. ...
    (rec.crafts.textiles.needlework)
  • Re: thread synchronization of flag
    ... implementing a flag like this. ... loads and stores? ... dependant state. ...
    (comp.programming.threads)
  • Any component like outlook 2003
    ... the one that stores ... the email headers, with the flag on the right and the ability to group ...
    (borland.public.delphi.thirdpartytools.general)