2

Ive set up a ServiceHost using WCF, as such:

enter image description here

Everything works fine, Server opens up ok, Clients can connect, etc..

The issue is that the main C++ application gets laggy when the Clients connect to the ServiceHost.

Is there any way to solve this issue?

Extra info: Debugging I can see that there is a WorkerThread answering to the Client requests, as a separate thread from the c++ main thread, but is seems to have more cpu time than the main thread.

Sergio Basurco
  • 3,488
  • 2
  • 22
  • 40
Hennio
  • 433
  • 2
  • 18
  • 1
    When you say CLI wrapper, do you mean you are using a com callable wrapper? https://msdn.microsoft.com/en-us/library/f07c8z1c(v=vs.110).aspx – tom redfern Sep 14 '15 at 09:03
  • I dont think so, its more like this wrapper: http://pragmateek.com/using-c-from-native-c-with-the-help-of-ccli-v2/ In order to use C# from C++ – Hennio Sep 14 '15 at 09:10
  • 1
    Hmm this is unfamiliar to me. I have used CCW before but not CLI. Maybe try CCW and see if this performance problem goes away? – tom redfern Sep 14 '15 at 09:39
  • @TomRedfern I have quickly developed de COM interface following http://www.codeproject.com/Articles/12673/Calling-Managed-NET-C-COM-Objects-from-Unmanaged-C Still the C# Service Host munches up cpu cycles from the C++ main thread, as if the service host is hooked up to the SynchronizationContext of the C++ thread (doesnt make sense..)? – Hennio Sep 16 '15 at 09:45
  • 1
    Sorry, my understanding of the topic has reached it's limits. – tom redfern Sep 16 '15 at 10:17

0 Answers0