• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

help to implement this idea

Nada Mohammed
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,
i need to write class work as server ,which perform different methods for different clients .This server has its own thread , which is reponsible to perform methods for clients .The client will put the request to server then back to continue its work .I now that there are diferent ways to implement this idea like :
1.for each instance in the server side there are two threads one is reponsible to perform request and the other is responsible to accepts requests from clients and put in queue .
but i think creating thread for each request is expensive
2.when client request method in the server side .This method will create new thread to handle client request .
but i think will not make client wait until resver accept its request .In anther word may be this way is faster in make clients back to continue its work .
3.server side just has one thread and use vector to accept requests from clients where vector is care about synchronized .Therefore it will accept request one by one ,then after server perform each request back and take new requests from this vector
i don't know which way is the best in increase performance and in reduce synchronization problems , where server methods need to be synchronized .
pleeease can any body tell me what are the different ideas to implement server class and which is the best .
Thanks a lot
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic