Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Synchronization

 
Tarun Oohri
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "synchronization in networking"? It's not a term that has a single commonly understood meaning.
 
Henry Wong
author
Marshal
Pie
Posts: 21194
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Henry Wong
author
Marshal
Pie
Posts: 21194
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 21194
81
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the link Henry!!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic