How does the Linux kernel identify cycles or loops in its data structures?
-
I am going through Linux Kernel development by it a great read. I just wanted to know how Linux kernel will identify cycles in its Data Structure like linked list, doubly linked list (which is possible in any system). Simple question will be what Algorithm Kernel implements to find circle Data Structure.
-
Answer:
In short, it is a trade off between adding more code to account for a programmer error and simplicity. The onus is on the programmer to write correct code, which will avoid aforementioned loops in data structures.
Pradeep Singh Rautela at Quora Visit the source
Other answers
Adding to Praddep's Answer. One example which can be understand as kernel never try to detect cycle is : It never checks for dead lock condition. For example if you take a lock on some resources, and further in that code again you try to take the same lock. This is infinite cycle, and kernel won't do anything for this, untill watch dog comes in picture and crashes your system.
Rahul Garg
Related Q & A:
- How would you transfer data between your data structures and databases?Best solution by Programmers
- How to boot linux kernel without bootloader?Best solution by Super User
- How to configure android kernel?Best solution by Stack Overflow
- How to get the timestamp of linux kernel?Best solution by Stack Overflow
- How to artificially cause a page fault in linux kernel?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.