Results 1 to 6 of 6
Thread: inter process communication
- 06-17-2008, 04:31 PM #1Member
- Join Date
- Jun 2008
- Rep Power
inter process communication
My code about generate requests simulation, I have to send 400 requests from client to server , I used TCP connection but in some times the server waite from client and the client also waite the response from the server ?
should I use inter-process communication between client and server ,How can I implemnt this .
for (int i=0;i<=400)
//send object to server
//receive response object from the server
I have to generate my requests exponintially.
- 06-22-2008, 04:21 AM #2
What's the problem?
It unlikely that any single computer will handle 400 simultaneous network connections, do you expect them all to work at once?
In general, its more reliable to queue requests in the main thread, and have one or more workers that do the actual network communications. The keeps one request from blocking all others.
The Java concurrency modules have suitable tools to build this.
- 06-23-2008, 12:31 AM #3Member
- Join Date
- Jun 2008
- Rep Power
Thank you very much
- 06-23-2008, 12:52 AM #4
If you are doing simulation, do it all in a program you write. You may be able to do 400 requests a second if the calling method and the responding method both reside locally on a machine you own and do not have any exposure to outside network.
You may do a great deal of code testing if the server and the client are both written in the same program for the purpose of doing feasibility studies, ones you wrote yourself and run yourself.
In fact, 4000 requests a second is not infeasible if you do not go to disk, use something from java.util that is classifiyable as Collections to simulate a collection of bytes on disk platter.
- 06-23-2008, 01:00 AM #5
Nick is correct, but I tend to write such programs as two separate small pieces of code, then execute both on the same machine.
Separate programs lets you do things like run several instances of the server code, so you can test the queuing system at assorted load levels
- 06-23-2008, 01:35 AM #6
simple server prototyping
I cannot get Pat's response to show in the thread view but yes, we can code them as separated code units. I sortof had the design idea of a single static access method with some tricky but simple logic so that two threads are running and we have to deal with the synchronized and volatile and so on. That accomplishes several things. First,... we get off of other people's hardware and help departments. Second,... we have to work out the access logic and that brings a conceptual understanding of a process running full duplex ( something that is addressed in a grossly inadequate manner in the plethora of books commonly available ) and Thirdly,... we can now do feasiblity studies on how and if the app will scale when an if someone who knows nothing about techie trys to ship the app to a powerful server..,
Pat, note that I cannot see your full counter-response while authoring this. We may have lost OP,... in which case we may direct poster to the server that ships with the sample code.
- By Java Tip in forum java.langReplies: 0Last Post: 04-09-2008, 06:37 PM
- By sureshjava in forum New To JavaReplies: 0Last Post: 01-29-2008, 05:56 AM
- By mathias in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 06:47 AM
- By paul in forum Advanced JavaReplies: 1Last Post: 08-07-2007, 04:54 AM
- By Ed in forum New To JavaReplies: 2Last Post: 07-04-2007, 05:03 AM