A resource sharing protection method and device
A technology for sharing resources and times, applied in the direction of resource allocation, multi-program installation, program startup/switching, etc., can solve the problems of CPU exhaustion and high CPU occupation, reduce times, reduce CPU usage, and solve deadlocks The effect of detecting problems
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment 1
[0043] In this embodiment, the process currently accessing the shared resource is called process A, the process A locks the shared resource, and the process requesting to access the shared resource is called process B. Such as figure 2 It is an implementation flowchart of Embodiment 1 of the present invention, including:
[0044] Step 201: Process B judges whether the shared resource has been locked, if yes, then execute step 202; if not, then process B locks the shared resource, accesses the shared resource, and releases the shared resource after the access is completed Lock.
[0045] Step 202: The CPU executes an idling instruction once, and adds 1 to the number of idling times of the CPU.
[0046] Step 203: Determine whether the number of CPU idling times is less than a preset threshold value of idling times. In this embodiment, the threshold value is 50 times. If it is less, execute step 201 again; if not, execute step 204.
[0047] Step 204: Determine whether the lock...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


