Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WCF Multithreading

Posted on 2011-03-04
3
Medium Priority
?
797 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
  • 2
3 Comments
 
LVL 45

Accepted Solution

by:
AndyAinscow earned 2000 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 45

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Screencast - Getting to Know the Pipeline
Suggested Courses

927 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