Go Back   ZeroC Forums > Help Center

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
  #1 (permalink)  
Old 04-01-2008
zouming zouming is offline
Registered User
 
Name: ming zou
Organization: NCIC, ICT, China
Project: self-adaptive middleware
 
Join Date: Mar 2007
Posts: 5
Smile thread pool (block reading?)

I has great interest in ICE. Recently I has read the source code of threadpool.
I find Ice uses leader-follower thread model. There are some critical areas that only one thread can run and Ice uses the "_promote" to control it.
Only one thread runs function finished(handle) or message()(at the begin of those functions) can release the "_promote", and another thread can go into the critical area and to epoll other message. But before handler->message(), the thread should execute read(handler); in the function read(handler), the thread must read all bytes of the message, so my question is"If the connection is slow and message body is huge, the thread has to stop at here and the thread don‘t release the "_promote", and other threads have no chance to epoll new data(but can execute the code of object method) 。If the server has a lot of connections, i think it will be a bottleneck“
i'm sorry for my poor english.
Reply With Quote
  #2 (permalink)  
Old 04-01-2008
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
The reading is done non-blocking, so if there is no more data to read, and the message is not complete yet, the thread will return to the thread pool and continue to epoll/select. It therefore does not matter whether a client is slow or not, since the leader thread won't wait for a slow client.

Note that in general, explaining Ice internals is out of the scope of the support we can provide here in our forums.
Reply With Quote
  #3 (permalink)  
Old 04-01-2008
zouming zouming is offline
Registered User
 
Name: ming zou
Organization: NCIC, ICT, China
Project: self-adaptive middleware
 
Join Date: Mar 2007
Posts: 5
Note that in general, explaining Ice internals is out of the scope of the support we can provide here in our forums.[/quote]

thank you for your replying, I just wonder why Ice using blocking reading.
your code is smart and i thought when poll's timeout is zero, it would block.
Reply With Quote
  #4 (permalink)  
Old 04-01-2008
marc's Avatar
marc marc is offline
ZeroC Staff
 
Name: Marc Laukien
Organization: ZeroC, Inc.
Project: The Internet Communications Engine
 
Join Date: Feb 2003
Location: Florida
Posts: 1,781
Note that Ice is not using blocking reading.
Reply With Quote
  #5 (permalink)  
Old 04-02-2008
zouming zouming is offline
Registered User
 
Name: ming zou
Organization: NCIC, ICT, China
Project: self-adaptive middleware
 
Join Date: Mar 2007
Posts: 5
Quote:
Originally Posted by marc View Post
Note that Ice is not using blocking reading.
thanks.
i have understood this part code. Ice not using blocking reading。
it is smart code
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
thread pool performance (500+ clients) Andrew S Help Center 6 05-11-2008 12:01 PM
Disable Server thread pool warning? spsoni Help Center 1 03-13-2008 11:26 PM
ICE thread pool model under windows simondu Comments 3 09-21-2007 07:08 AM
monitor util thread block at windows system Jacky_Lee Bug Reports 4 06-01-2007 03:10 AM
Thread Pool and Network Problems acbell Help Center 4 11-10-2006 05:08 PM


All times are GMT -4. The time now is 10:07 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.