Impact of Gen-AI on IT Jobs - Growth Mindset Show
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
3
Reply
what is Deadlocks
Purushottam Rathore
16y
5.4k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
In very simple way
When two processes are waiting for each other for infinite time It is called deadlock
kanchan setia
14y
0
I think, this problem can be solved by, at first thread1 check status of Y, if Y is locked by another thread (thread2), loop the process: wait for a random interval of time and don't hold lock on X. Check status of X, Y, if both of X and Y are not locked then run thread1.
Long Nguyen Thanh
15y
0
Deadlock is a famous problem you can avoid simply by careful programming. let us assume that we have two threads, thread 1, and thread 2. Let us assume, as well, that we have two objects, object x, and object y. If thread 1 holds a lock on object x and waits for a lock on object y, and thread 2 holds a lock on object y, and waits for a lock on object x then threads will be waiting forever! and this is what we call a deadlock situation.
Purushottam Rathore
16y
0
Message