Solved

WCF Multithreading

Posted on 2011-03-04
3
785 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 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

777 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