Reputation: 3611
I have a block of work which ive split into smaller blocks. I want to assign each block to an instance of NumberCruncher (Each instance would be hosted at a unique EndPoint and would be run on a specific thread on the server). The instance of NumberCruncher at the specified EndPoint would then go and crunch those numbers passed to it by the Client proxy, before returning the results in a txt file format.
From a client side, Im assuming i need to keep 2 threadsafe list, 1 containing the EndPoints linked to instances of NumberCruncher which are waiting to return their results. A 2nd for the instances of NumberCruncher which are waiting to be assigned more work?
Regarding adding items to these lists, how is it possible to deal with multiple requests from Servers? Only one can be added at a time, so im assuming the client need to send a message back to the service saying "Yes you were successfully added to the list, now stop requesting to be added."?
EDIT
I'm currently trying to run some analysis on a time series i have collected. Ive written a program (Number Cruncher) which splits the different parameters i want to check and assigns them to different threads (determined by the number of cores in my pc). Each thread then runs Number Cruncher with the assigned input. Unfortunately this is taking a stupid amount of time on my pc even when using all the cores. So i wanted to run this same program but on several pc's (servers), and write a single program which would allocate work to all the servers. Each simulation takes about ~1hr. So im looking at 520hrs of computation time (ie not feasible for a single pc).
Upvotes: 0
Views: 328
Reputation: 273854
I think you're over thinking this.
In WCF you do have some control over the number of instances (single, per-session and per-request) and whether an instance is single or multi-threaded. But not over thread-affinity of a request.
And you don't need to, it seems to me you should just configure instance-per-request (depends very much on details of the coding and state-management).
You can throttle the server to achieve maximum capacity and acceptable latency. Don't mess with thread-management if you don't have to.
After the Edit
You can use WCF for this but it is a distributed computing problem, specialized software exists.
You could run the worker PCs as server, this seems to be your current direction. But I would:
Upvotes: 1