• Post Reply Bookmark Topic Watch Topic
  • New Topic

what synchronized

 
manu chaox
Ranch Hand
Posts: 110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What should be synchronized on a server side in this situation?

I am creating easy a server and a client application.
- Clients send files to server.
- The server creates a Thread for every connection, the Thread reads data from socket and save it to file.

Thanks for help
 
Ajay Saxena
Ranch Hand
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see any need for synchronization here for each thread is going to read from its own socket. As per your problem description,there's nothing that's being concurrently accessed by multiple service threads on the server.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So far, probably nothing. Keep an eye out for any resources shared by multiple threads. Do they all write to the same file? That would be one. Do they all use the same component to make up random filenames? That might be one, too. Or you might not have any!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!