Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsWindows Server 2003Windows 2000Windows NTSmall Business ServerVirtual ServerExchange ServerIISHost Integration ServerISA ServerSMSWSUSMOMWindows Media ServerSecurityCertification
Related Topics
SQL ServerMS WindowsMS OfficePC HardwareMore Topics ...

Windows Server Forum / Windows 2000 / Terminal Services / November 2006

Tip: Looking for answers? Try searching our database.

Data synchronisation issues on Virtual channels

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc - 06 Nov 2006 20:16 GMT
Hi

Can I have many processes write to the same virtual channel?

I am doing tests to try to understand how channels work.  I have a server
side exe
and a Client.DLL running together.  I am exchanging data between the two
successfully.

Using one channel on one client dll I run 10 instances of my application.exe
that
resides on the server.  When all 10 applications are writing and reading data
simultaneously I am finding that the process that did the write on the
channel isn't
always the process that does the read.  Another process reads the data
sitting on
the channel.

Am I supposed to have one client.dll per process running on the server?

My test is very simple I pass an integer to the client DLL increment it by 1
on the
client side and return it to the server side.  I do this in a for loop.

When I run one instance my output is sequential. 1,2,3,4,5,6,7....
When I run several instances of the same exe I get something that looks like
this
1,3,5,8,11, etc... Random output.

How can make make sure the the process that did the write is the one doing
the
read, and that my writes and reads are being mixed up from process to process.

Thanks for the info,
Marc
Marc - 10 Nov 2006 16:05 GMT
Here is the solution to the problem

From the server side wrap your calls in a mutex and use WaitForSingleObject .

Psuedo code
createmutex
WaitForSingleObject
WriteToChannel
ReadFromChannel
ReleaseMutex

This will guarantee that 2 processes will not write and read on the channel
simultaneously.

This also assumes you have control of both ends server and client.

Marc

Signature

...

> Hi
>
[quoted text clipped - 31 lines]
> Thanks for the info,
> Marc
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.