Re: Fast Multiple Application Comunication
- From: "Greg Young" <DruckDruckGoose@xxxxxxxxxxx>
- Date: Fri, 12 May 2006 07:33:33 -0400
Yes .net
does support mutex's for thread synchronisation but this is a different
kind of implementation I believe it only allows access within the
application domain. Another kind of mutex can be used to access the
same object from many applications but I have not found a way to do
this in the .net framework. This is how Shared Memory works it creates
a named mutex of memory that can be accessed from many applications. I
think the reason that shared mutexs are not generally recomended is
that there is no guarantee that the mutex you are connecting has the
same structure.
Your assumptions on mutex are incorrect.
A mutex is an OS level locking mechanism ... nothing more ... It is
generally used to synchronize seperate processes. Think of it like a Monitor
(i.e. lock() { }) that can be used through multiple applications.
A mutex is used to synchronize access to global resources (like a shared
file or shared memory). It does not contain any real storage itself.
As for not having the "same sata structure", a mutex will always be a mutex,
this issue may apply to the shared resource but the same issue would apply
to any shared resource (I can easily connect a mail client to a server it
doesn't understand how to deal with and it will not work very well).
Cheers,
Greg Young
MVP - C#
"Olie" <owaits@xxxxxxxxx> wrote in message
news:1147432292.133503.215260@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Yes that is a good point about the number of clients. The requirement
is for up to 20 clients which is relatively small. A broadcast method
would be fine but I do need to ensure that any message gets to all the
clients.
Correct me if I am wrong Greg but I do not believe that I did leave out
Shared Memory or Shared Files as I think Shared Mutex is a lower level
abstraction on Shared Memory and Pipes is an implementation of Shared
Files. I should have maybe elaborated on the Mutex a bit more (cause of
much confusion and I do not profess to have got it correct). Yes .net
does support mutex's for thread synchronisation but this is a different
kind of implementation I believe it only allows access within the
application domain. Another kind of mutex can be used to access the
same object from many applications but I have not found a way to do
this in the .net framework. This is how Shared Memory works it creates
a named mutex of memory that can be accessed from many applications. I
think the reason that shared mutexs are not generally recomended is
that there is no guarantee that the mutex you are connecting has the
same structure.
Thanks Steve, I was definately leaning towards Named Pipes I just
wanted to see if there was a solution to be found that is built into
the .net framework. I am slightly confused that Micrsoft did not think
of the need for fast comunication when developing the framework.
.
- References:
- Fast Multiple Application Comunication
- From: Olie
- Re: Fast Multiple Application Comunication
- From: Willy Denoyette [MVP]
- Re: Fast Multiple Application Comunication
- From: Olie
- Fast Multiple Application Comunication
- Prev by Date: Re: Exception Handling
- Next by Date: Re: Fast Multiple Application Comunication
- Previous by thread: Re: Fast Multiple Application Comunication
- Next by thread: Re: Fast Multiple Application Comunication
- Index(es):
Relevant Pages
|