Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 03-07-2008
LAstakhov's Avatar
LAstakhov LAstakhov is offline
Registered User
 
Name: Leonid Astakhov
Organization: Kaspersky Lab
Project: AVP
 
Join Date: Mar 2008
Posts: 8
C# ThreadPool question

Hi,

I'm trying to use ICE with C# on Windows

I'm writing a simple server application which receives messages from clients.
In my server application I create a single object exposing a single interface.

From the client I connect to this server through a proxy object and send a message to the server 30 times per second.

I configured my server to use ThreadPool.

When I start 300 clients sending messages to one server it looks like ThreadPool doesn't work. I have 2x4 Core CPU server and if I open TaskManager I see that only 2 cores are doing something while another 6 are idle.

Server looks like this:

public class ServerI : IServerDisp_
{
public overrive void Message ( string msg )
{
...
}

}

If I have a single object serving all incoming requests and if I configure
ICE to use ThreadPool does this mean that method void Message could be called simultaneously by many threads?

Looks like there is some point of serialization where all requests are queued and then processed subsequently?
Reply With Quote
  #2 (permalink)  
Old 03-07-2008
dwayne's Avatar
dwayne dwayne is online now
ZeroC Staff
 
Name: Dwayne Boone
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Jan 2005
Location: St. John's, Newfoundland
Posts: 209
Please see this FAQ.
Reply With Quote
  #3 (permalink)  
Old 03-11-2008
LAstakhov's Avatar
LAstakhov LAstakhov is offline
Registered User
 
Name: Leonid Astakhov
Organization: Kaspersky Lab
Project: AVP
 
Join Date: Mar 2008
Posts: 8
Unfortunately FAQ doesn't help

Here is more theoretical question:

1. I have single servant ServerI
2. I create many Object Adapters and add this single Servant to each
3. Many clients connect through different object adapters to the single servant and execute the same method void Foo()

Question is: will there be any point of sinchronization where all the calls to method Foo() will be queued? or there is a possibility to call the same method Foo() simultaneously in different threads?
Reply With Quote
  #4 (permalink)  
Old 03-11-2008
matthew's Avatar
matthew matthew is online now
ZeroC Staff
 
Name: Matthew Newhook
Organization: ZeroC, Inc.
Project: Internet Communications Engine
 
Join Date: Feb 2003
Location: NL, Canada
Posts: 1,061
Quote:
Originally Posted by LAstakhov View Post
Unfortunately FAQ doesn't help
Why doesn't the FAQ help? If the methods are not being concurrently dispatched by the Ice run time there can only be two reasons:

- There are not multiple threads in the thread pool attached to the servants OA.
- The methods are not called concurrently on the server.

What can also easily occur is that methods are dispatched concurrently, but you misinterpret the results. For example, if your servant implementation does almost nothing then there is little chance for methods to be concurrently called. Another easy way to misinterpret results is caused by your servant implementation itself preventing concurrent execution due to some synchronization. This does not mean that the Ice run-time is not calling your servant methods concurrently, it means that your servant has some synchronization that prevents the methods executing concurrently.

Quote:
Here is more theoretical question:

1. I have single servant ServerI
2. I create many Object Adapters and add this single Servant to each
Why would you want to do that? Except in special circumstances this is not necessary. See http://www.zeroc.com/faq/multipleOA.html for details.

Quote:
3. Many clients connect through different object adapters to the single servant and execute the same method void Foo()

Question is: will there be any point of sinchronization where all the calls to method Foo() will be queued? or there is a possibility to call the same method Foo() simultaneously in different threads?
The Ice run-time will not queue requests. A request is dispatched them as soon as a thread from the OAs thread pool is available.

Last edited by matthew : 03-11-2008 at 06:26 AM.
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ThreadPool warning when Size=MaxSize jae Help Center 1 12-28-2007 10:03 PM
Strange ThreadPool size warning mefoster Help Center 1 10-02-2007 06:08 AM
How to get Ice.ThreadPool.Server sinofool Help Center 2 07-10-2007 11:43 AM
Ice.ThreadPool Error Message Yunqiao Yin Help Center 1 02-26-2007 11:54 PM
Question on ThreadPool ylangin Help Center 1 03-23-2006 09:27 AM


All times are GMT -4. The time now is 10:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0
(c) 2008 ZeroC, Inc.