Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <p>So that when it does that, the calling task blocks. Then the queue waits for X calls to accumulate</p> </blockquote> <p>If the queue receives x calls (x &lt; X) then the calling task will block until another task pushes the total >= X. If you only have one task that wants to make N * x calls, it will get stuck.</p> <p>If your application usually has a lot of tasks running, then you might only see this problem intermittently - where you have unusually low load, or a clean shutdown.</p> <p>You could solve this by adding a time out, so that the queue will send the batched requests anyway if no requests have been added within a time limit, and/or the first request has been waiting longer than a time limit.</p> <blockquote> <p>I could of course rewrite this code to make the list of requests on the Parent class and then call the service.</p> </blockquote> <p>Perhaps you are on the right track with this approach. Could you find a way of replacing the generated method implementation with a hand-coded implementation, by delegation, inheritance, lambda method, or enhancing your generator?</p> <hr> <blockquote> <p>... with my real problem all this code is generated.</p> </blockquote> <p>One point that I'm not quite clear on is which parts of the code are generated (hard to modify) and which parts of the code can be modified to solve this problem?</p> <ol> <li>Child.RemoteCall()</li> <li>Parent.SumChildren()</li> <li>Neither of the above.</li> </ol> <p>If it's neither of the above then you have to be able to modify something in order to solve the problem. Are the Parent and Child instances built by an AbstractFactory? If so, then it might be possible to insert a proxy to the Child instances that can be used to modify the non-functional aspects of their behavior(s).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COHi Rich, Yeah, obviously the queue should fire anyway after 100ms or so, so it won't block. I left that out for brevity because it didn;t realy touch the essence of the problem. Rewriting would be very difficult. The internal implementation of Child.RemoteMember may have memoization, so it wouldn't actually have to make the call. Or it could be a IChild, a proxy to a remote object. Wich is not known at compiletime. Those are just 2 reasons why trying to rewrite compiletime is going to be harder than what i was thinking of. So I still want to see if this can be done. Any ideas? GJ
      singulars
    2. COThis would make an interesting question on its own because it's an example of an abstraction that has been too successful in hiding the non-functional aspects of the implementation (remoting and performance). If the child instance has a pre-computed answer available locally it doesn't make sense to process the request remotely. Similarly there is no advantage to batching these requests. If the queue could detect these and evaluate them immediately (without batching), then that would only leave the remote requests to be batched.
      singulars
    3. COI found this link: http://msdn.microsoft.com/en-us/magazine/cc163340.aspx interesting. I'm not sure if Tasks and Futures are quite right for this problem. They might help but they're not a perfect fit. The task manager defaults to one thread per core - but with remote requests, some of the threads will be blocked, so multiple threads per core can give a better throughput. The number of cores on the server is possibly more relevant than the number on the client.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload