Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the locks in processes and threads

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article shares with you what locks are in processes and threads. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Shared lock (S lock): if transaction T adds a shared lock to data A, other transactions can only add a shared lock to A, not an exclusive lock. Transactions that are allowed to share locks can only read data and cannot modify it.

Exclusive lock (X lock): if transaction T adds an exclusive lock to data A, other transactions can no longer add any kind of blockade to A. Transactions that are granted an exclusive lock can both read and modify data.

There can be shared locks in 2.Windows

3. Other users can read and query data concurrently. But you can't modify, add, or delete data.

4. The so-called deadlock: refers to two or more processes in the implementation process, caused by the competition for resources caused by a mutual waiting phenomenon, if there is no external force, they will not be able to move forward.

Release deadlock: when a deadlock is detected in the system, the process must be freed from the deadlock state. A common implementation is to undo or suspend processes in order to reclaim some resources and then allocate them to processes that are already in a blocked state and make them ready to continue to run.

Thank you for reading! This is the end of this article on "what are the locks in processes and threads?". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report