Solved

WCF Multithreading

Posted on 2011-03-04
3
792 Views
Last Modified: 2013-12-17
I am developing an application with one server and several clients connected through WCF.

The server app keeps a collection of all transaction objects (which stores the start time, end time, type of transaction, etc). The client apps are used for monitoring the transactions remotely.

When a client app first connects to the server app, the server app would send the whole collection to the client. How can I do that on a separate thread? Since I will be sending the whole collection, then I will need to lock it, thus preventing my main thread from modifying the collection making it work on a separate thread pointless.
0
Comment
Question by:Thomasian
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 500 total points
ID: 35036099
You could make a copy - which should be rapid (?) - then send the copy via another thread for the slower transmission.
0
 
LVL 22

Author Comment

by:Thomasian
ID: 35036680
How do I send the changes to the collections then? When transaction are added/modified also need to update the client. But since it could only be sending one transaction for the update, is it possible that the client receives the update first before the collection?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 35037343
1) How do I send the changes to the collections then?
2) When transaction are added/modified also need to update the client.
3) But since it could only be sending one transaction for the update, is it possible that the client receives the update first before the collection?


1) I don't know how you could 'push' from server to client.  However your client could easily have a timer loop that checks the server for some ID of the latest update and 'pulls' via the same mechanism as the initial update (changes since ID zero for instance)

2) see 1)

3) Only if the client uses multiple threads to get data from the server.
0

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question