Need help on Mutex

  • Thread starter =?iso-8859-1?B?YUKj?=
  • Start date
?

=?iso-8859-1?B?YUKj?=

Hello all,

I have an application which will seek the sql server table whether it
is updated or not.

This application runs once in 60 seconds.

But the sql server table doesnt get updated frequently. So I thought
of a logic where in the global.asax of my web application im invoking a
semapore whenever any request comes.

And the external application will share the semaphore.

Can anyone help me out with a logic. The main or primary aim is to
minimize the overhead on my server.

Thanks in advance.

Abraham.
 
A

Andy Fish

it depends what type of "application" is monitoring the sql server table.
Assuming it's a separate process (application domain) I don't think you can
use .Net synchronization primitives. Also there is no built-in support for
named pipes or memory-mapped files, so really you'd need to use tcp/ip (e.g.
make the application host a web service).

to be honest, if there is no need to poll more often than 60 seconds, I
wouldn't be that worried about the extra processing involved. you're looking
at coding a load of possibly-troublesome synchronization code to save a few
milliseconds once a minute.

Andy
 
S

Scott Allen

You can use a named mutex to communicate across processes, but it
seems like overkill (you probably really want a named event instead).

Polling the database is a simple approach with little overhead. Have
you measured the impact?

If you really want to avoid polling, I'd look at a safer alternative,
like message queuing with MSMQ.
 

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

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top