Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 07-21-2005
OrNot OrNot is offline
Registered User
 
Name: Bin.Li
Organization: GE Healthcare
Project: Enterprise solution
 
Join Date: Jun 2005
Location: Shanghai
Posts: 157
Send a message via MSN to OrNot
-->
Question about the Connection#4.

Hi, Matthrew,
In the file "Config.Server" of sample codes in the connection#4, you increased the ThreadPool.Client.Size to 4 and commented that " Since the server makes calls from an AMI callback its necessary to increase the size of the client thread pool."
My question is that whether the "increasing" is necessary otherwise will lead to deadlock or is preferable otherwise may lead to the thread starvation?
If the latter, why did you not increase the ThreadPool.Server.Size?
I am always afraid of the deadlock when I am programming using ICE, especially when I have to select a proper thread number. So far as to me , what I can do is to avoid the nested callbacks

Hope getting your help.

Thank you .

OrNot
Reply With Quote
  #2 (permalink)  
Old 07-21-2005
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,060
AMI replies are dispatched using the client side thread pool, hence it must be increased not the server side. If the thread pool size isn't correct the application will deadlock (unless you are using timeouts). See 30.3.4 in the Ice manual for more details.

Regards, Matthew
Reply With Quote
  #3 (permalink)  
Old 07-21-2005
OrNot OrNot is offline
Registered User
 
Name: Bin.Li
Organization: GE Healthcare
Project: Enterprise solution
 
Join Date: Jun 2005
Location: Shanghai
Posts: 157
Send a message via MSN to OrNot
-->
Thank you Matthrew. I have read the 30.3.4 carefully again. It's helpful. But I still have some questions .
1)
Quote:
If the thread pool size isn't correct the application will deadlock
You are right. But so far as the sample codes in #4, it seems that the deadlock would not happen and the "increasing" of the client threadpool size is only to deal with the "simultaneous callbacks", that is, to deal with the thread starvation for the situation where many invitees agree or reject the invitations and make the callbacks at the same time.
similarly, I think the server threadpool size also should be increased in case that many invitations from many users arrive at the chat server at the same time. In current configure, these invitations are serialized and then dispacthed asynchronously.
In a word, I think that since we have increased the client thread pool size to deal with the simultaneous callbacks, we'd better increase the server threadpool size to deal with the simultaneous requests.

2) The value 4 is set only by experiences or obey some rules such as in the Nested demo ,which used a sz*2 formula?

Best Regards-OrNot

Last edited by OrNot : 07-22-2005 at 12:52 AM.
Reply With Quote
  #4 (permalink)  
Old 07-22-2005
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,060
Sorry, the configuration file comment is incorrect on this point.

The server as it stands can actually can work with a client side thread pool of size 1 since the AMI callback only makes replies on an AMD callback object. The AMD callback sends the message in the calling thread, and glacier2 cannot block.

The thread pools, as you say, can be set larger to allow higher concurrency.

Regards, Matthew
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
A question about Ice connection laotee Help Center 3 10-26-2005 04:02 AM
Question about the Connection#5 OrNot Help Center 1 08-07-2005 11:16 PM
A question about bidirectional connection rc_hz Help Center 3 07-21-2005 08:12 AM
A question about Connection Reuse in Ice rc_hz Help Center 5 06-01-2005 08:31 AM
A question about Connection Management rc_hz Help Center 9 05-31-2005 11:57 PM


All times are GMT -4. The time now is 09:50 PM.


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.