How to wake up an asynchroneous process ?

G

Gilbert Tordeur

Context : Windows Server 2003, IIS 6, VB 2008

My asp.net application A stores data in an SQL 2000 database. My application
B (on the same server but under a different userid - not ASPNET) reads these
data, does its job (big load, low priority) and updates the database. A does
not wait any answer nor acknowledgement from B.

Questions :
1) I think B can be a console application, am I right ?
2) How can A wake up B when A has stored data for B in the database ?
3) How can B wait when it has completed a task, until A wakes it up ?

Thank you,
Gilbert
 
J

JB

One thought would be to add a table to the database containing a single row
with two columns. Col1 is the last datetime that A updated the data and Col2
is last datetime that B did its thing. When A updates the data, it updates
the Col1 date. B then checks the dates and if col2 date is earlier than Col1
datetime, it does its work and finishes by updating Col1. B could be any
sort of app that runs on a timer, e.g. a .net app using a form timer or an
app using a thread with a sleep that times out. When the "timer" event is
raised, B checks the dates and either goes to work or goes back to sleep.
 
F

Family Tree Mike

1) My feeling is B should be a service so that it is not dependent on a
logged in user. The ASP activity from A may occur when there is no active
login, correct?

2) A should not "wake up" B, but B should periodically poll the data. By
the nature of your setup there is some latency for the "B" operation,
meaning it is not as immediate as A doing the store. Therefore if the timer
in the service fires every N Insert_Your_Favorite_Time_Units, then things
should be fine.

3) As I think things should be set up, this question is moot.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top