 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Mustafa Korkmaz Guest
|
Posted: Thu Feb 19, 2004 3:31 pm Post subject: Is it necessary to extra organization for multible sending t |
|
|
Is it necessary to extra organization for multible sending to clients?
There will be alot of clients these are connected to my Server program.
Alot of clients will want to send message to each other over Server.
For example this is a chat application..
I have not used any extra thread at Server side. I only use TidTCPSErver and
TidThreadMgrPool.
if the Server want to send a message to any client it use this method:
AThread.Connection.WriteBuffer (...);
Server knows Athreads of the clients.
What happens when 100 clients want to send message to other clients in the same time?
All necessary organizations is being done by TidTCPSErver and TidThreadMgrPool components?
Is there any wrong thing in this description?
All necessary multi threading operations is being done by Indy for Server side.
I will not create any extra thread.And I will not think for any buffer confliction.
I want to be sure.
Thanks
Mustafa
|
|
| Back to top |
|
 |
Martin James Guest
|
Posted: Thu Feb 19, 2004 4:10 pm Post subject: Re: Is it necessary to extra organization for multible sendi |
|
|
"Mustafa Korkmaz" <mkorkmaz42 (AT) hotmail (DOT) com> wrote
| Quote: |
Is it necessary to extra organization for multible sending to clients?
|
To be sure, and to enable any practical debugging, add extra organisation.
To start with, I would add one thread that does all management & post all
requests to it. This would be the only place where the client List would be
accessed. No client thread would be permitted to close without permission
from this thread. No client would be allowed to log on without notification
to this thread. All writes would be done, or at least triggered, from this
thread.
Without debuggable organisation, I would not approach anything like a chat
server.
Only after the management worked with no AVs or other problems would I
attempt optimisations for performance.
The thought of hundreds of threads asynchronously attempting to lock &
unlock a threadList while clients are busy trying to connect & disconnect
fills me with dread.
Rgds,
Martin
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|