Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 83
    So, basically this Synchronized keyword makes your methods thread-safe? Commented Jul 6, 2009 at 7:12
  • 94
    The synchronized keyword is one of the tools that make your code thread safe. Just using synchronized on a method or variable in itself may or may not do the trick. Having a basic understanding of the Java Memory Model is really important to getting concurrency correct. Commented Jul 6, 2009 at 7:14
  • 34
    Unless you are Brian Goetz (or maybe Jon Skeet), it is almost impossible to get Java concurrency correct with only the language primitives (synchronized, volatile). For starters, make use of the java.util.concurrent package and build on top of that. Commented Jul 6, 2009 at 7:30
  • 14
    More clearly: synchronized methods can't be called in the same time from multiple threads. Commented Mar 15, 2016 at 12:35
  • 3
    @dhfromkorea nope. totally different. in practice 'serialized' is the process of taking an object, which may be stored in various places memory, and 'serializing' it into a single dimensional array of bytes. this is done for storage or transmission. Commented Nov 27, 2016 at 16:06