File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Synchronization Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Synchronization " Watch "Synchronization " New topic
Author

Synchronization

Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 166
Hello Everybody!!

Why is it that , Synchronization makes networking faster where as in Java Synchronization makes process slower ?
I know the answer of the later half of the question, please care to throw some light on networking
Thanks !!!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39541
    
  27
What do you mean by "synchronization in networking"? It's not a term that has a single commonly understood meaning.


Ping & DNS - updated with new look and Ping home screen widget
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18103
    
  39

Ulf Dittmer wrote:What do you mean by "synchronization in networking"? It's not a term that has a single commonly understood meaning.


Perhaps this question is referring to "Asynchronous I/O", as some sources refer to not using Asynch I/O as "Synchronous I/O" ?

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18103
    
  39

Tarun Oohri wrote:
Why is it that , Synchronization makes networking faster where as in Java Synchronization makes process slower ?
I know the answer of the later half of the question, please care to throw some light on networking
Thanks !!!


Also, you should tell us what you mean by "Java Synchronization"? In general speak, it is referring to threads. Are you referring to threads?


And, if you are referring to threads, what do you mean by "makes process slower"? Slower than what? Slower than not using synchronizations?

Henry
Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 166
Thanks everybody for your feedback...This was the question asked to me in the interview, Though i couldn't remember it correctly .
No it is not related to threads, i did answered the interviewer in thread context only, but he was like "i am not asking about threads".
I know the concept of synch. in threads but do not know the Synch. or Asych. concept of networking ... Any clues ?
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18103
    
  39

Tarun Oohri wrote:Thanks everybody for your feedback...This was the question asked to me in the interview, Though i couldn't remember it correctly .
No it is not related to threads, i did answered the interviewer in thread context only, but he was like "i am not asking about threads".
I know the concept of synch. in threads but do not know the Synch. or Asych. concept of networking ... Any clues ?



Perhaps the Oracle tutorial would be a good starting point on the subject ?? ... http://docs.oracle.com/javase/tutorial/essential/io/fileio.html


EDIT: BTW, forgot to mention that asynchronous I/O is only a small part of the NIO library. To get to what you want, you need to examine the socket channels -- particularly the asynchronous options.

Henry
Tarun Oohri
Ranch Hand

Joined: Feb 20, 2013
Posts: 166
Thanks for the link Henry!!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Synchronization
 
Similar Threads
terracotta question ?
How synchronize between Threads ?
SimpleDateFormat.. not Synchronized
Sychronized class
Check current time on two different Linux Box