Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Programming \ Java synchronization mechanism used in locking Thought     - PXE + Kickstart automatically install CentOS 6.5 (Linux)

- CentOS 6.5 opens the Xmanager Remote Desktop login (Linux)

- To use Java arrays implement the order form (Programming)

- Linux System Getting Started Learning: hard disk partition, and to deal with traps (Linux)

- Terminal fun: 6 interesting Linux command-line tools (Linux)

- Linux Mint under tty.js Installation Guide (Linux)

- To install Spotify in Ubuntu / Mint (Linux)

- Linux users should be aware that should the 7 ls command unique skills (Linux)

- Use Ansible to bulk manage remote servers (Server)

- Hadoop 2.6.0 stand-alone / pseudo-distributed installation (Server)

- Linux System Getting Started Learning: After starting in Ubuntu or Debian, enter the command line (Linux)

- Arronax allows you to easily create desktop startup file (Linux)

- Linux netstat command to get started (Linux)

- Linux terminal interface font color settings (Linux)

- How to install new fonts on Ubuntu 14.04 and 14.10 (Linux)

- Build Golang development environment configuration on Ubuntu 14.04 (Linux)

- Linux script commands - terminal recorder (Linux)

- KVM virtualization of nested virtualization (Linux)

- Java in the inverter and covariance (Programming)

- Share useful bash aliases and functions (Linux)

  Java synchronization mechanism used in locking Thought
  Add Date : 2018-11-21      
  Lock is a computer term "lock" is an idea, but in different areas have different implementations. For Java thread synchronization, the lock there are two: First, the object lock; Second, Locks;

Object lock acting on the non-static class synchronization method of asynchronous method did not have any effect.

Internally Java platform, it will assign an object lock for each object. There are two open lock state (lock belong to the object), lock (lock belongs thread)

Java platform method of synchronizing the following principles:

1, when a thread synchronization method when you want to refer to the calling thread will apply to the Java platform through an object lock; if the lock open, Java platform lock the object lock, thread acquires the object lock.

2, if the object lock is locked, the application thread needs to lock objects, which are the object lock to open the object locking thread

3, the thread obtained after the object lock, Java platform allows an object to refer to any thread synchronization methods to access an object within the scope of the examples

4, a thread of execution after the completion of the synchronization method, the object must be returned to the lock, the lock also opens the object for use by other threads.

5, when the object lock open, Java platform whether any threads waiting for object locks, there will be the object lock to lock this thread. Then wake up the thread continues execution. If you do not return the object lock object entity.

For class locks and lock objects only difference is that there is only static synchronized methods of a class type lock. Processes and objects lock the same.
- How MAT Android application memory leak analysis (Programming)
- Java call by value and by reference (Programming)
- Android WebView use layman (Programming)
- Three kinds of binary tree traversal recursive and iterative solution (Programming)
- Oracle Automatic Diagnostic Repository (Automatic Diagnostic Repository, ADR) (Database)
- Production environment Linux bonding method standby mode slave card switch (Server)
- VMware virtual machine can not start VMnet0 no Internet access and other issues (Linux)
- CentOS network configuration 7, and set the host name and IP-bound problems (Linux)
- Linux resource restriction level summary (Linux)
- Bash environment is automatically install and initialize oh-my-zsh & autojump zsh (Linux)
- Django Signals from practice to source code analysis (Programming)
- Wireless LAN security solutions (Linux)
- Linux modify the system time (Linux)
- C ++ virtual functions Classic Insights (Programming)
- OpenDJ installed on RHEL6 (Linux)
- The top command under Linux (Linux)
- Gitblit adopted Ticket collaborative development model (Linux)
- Object-oriented language Java some of the basic features (Programming)
- Elaborate .NET Multithreading: Using Task (Programming)
- How to install Linux Go Language (Linux)
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.