Method and apparatus for controlling access by a plurality of concurrently operating processes to a resource
First Claim
1. A method for controlling access by a plurality of concurrently operating processes to a resource, said method comprising the steps of:
- allocating an area of storage and defining a pre-determined number of storage slots therein;
responsive to a request by one of said processes for shared access to said resource, determining whether to allocate shared access, and if so, allocating said requesting process shared access, said step of allocating shared access comprising;
acquiring one of said storage slots; and
wherein said method further comprises;
responsive to a request by one of said processes for exclusive access to said resource, determining whether to allocate exclusive access, and if so allocating said requesting process exclusive access, said step of allocating exclusive access comprising;
acquiring all of said storage slots.
3 Assignments
0 Petitions
Accused Products
Abstract
The invention relates to controlling access by a plurality of concurrently operating processes to a resource. An area of storage is allocated and a pre-determined number of slots defined therein. Responsive to a request by one of the processes for shared access to the resource, a determination is made as to whether to allocate shared access, and if so, the requesting process is allocated shared access upon the acquisition of one of the storage slots. Responsive to a request by one of the processes for exclusive access to the resource, a determination is made as to whether to allocate exclusive access, and if so exclusive access is allocated upon the acquisition of all of the storage slots.
55 Citations
51 Claims
-
1. A method for controlling access by a plurality of concurrently operating processes to a resource, said method comprising the steps of:
-
allocating an area of storage and defining a pre-determined number of storage slots therein;
responsive to a request by one of said processes for shared access to said resource, determining whether to allocate shared access, and if so, allocating said requesting process shared access, said step of allocating shared access comprising;
acquiring one of said storage slots; and
wherein said method further comprises;
responsive to a request by one of said processes for exclusive access to said resource, determining whether to allocate exclusive access, and if so allocating said requesting process exclusive access, said step of allocating exclusive access comprising;
acquiring all of said storage slots. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)
checking whether any one of a set of storage slots is unallocated; and
said step of allocating shared access comprises;
responsive to one of said set of storage slots being unallocated, acquiring one of the unallocated slots.
-
-
3. The method of claim 1, wherein the step of determining whether to allocate shared access comprises:
-
selecting a storage slot; and
determining whether said storage slot is owned by another process; and
wherein said step of allocating shared access comprises;
responsive to said storage slot not being owned by another process, acquiring said selected storage slot.
-
-
4. The method of claim 1, wherein each process comprises at least one thread having a unique thread id, each process indicating ownership of a storage slot by associating the thread id of the thread requesting access to said resource with said storage slot.
-
5. The method of claim 1, wherein each process has priority information associated therewith.
-
6. The method of claim 5, wherein the step of allocating shared access further comprises:
responsive to determining that a first storage slot is owned by another process, performing an action based on the priority of said requesting process.
-
7. The method of claim 6, wherein in response to the requesting process having a low priority, said action comprises the steps of:
-
waiting for said first storage slot to be relinquished by said owning process; and
responsive to said first storage slot being relinquished, acquiring said first storage slot.
-
-
8. The method of claim 6, wherein in response to the requesting process having a high priority, said action comprises the steps of:
-
selecting storage slots until an unallocated storage slot is selected; and
responsive to selecting an unallocated storage slot, acquiring said unallocated storage slot.
-
-
9. The method of claim 8, wherein no more than a predetermined number of storage slots are selected, said method further comprising the steps of:
-
responsive to none of said selected storage slots being available, waiting for the last of said selected slots to be relinquished by an owning process; and
responsive to the last of said selected slots being relinquished, acquiring the last of said selected slots.
-
-
10. The method of claim 1, wherein an input queue is associated with at least one of said storage slots.
-
11. The method of claim 10, wherein responsive to determining that processes are queued on a selected storage slot, selecting another storage slot.
-
12. The method of claim 10, comprising the step of:
ordering queued processes according to priority information associated therewith.
-
13. The method of claim 12, comprising the step of:
moving a high priority process to the head of a queue.
-
14. The method of claim 5, wherein a process requesting shared access and having a low priority selects a storage slot from a first part of said storage area.
-
15. The method of claim 14, wherein a process requesting shared access and having a high priority selects a storage slot from a second part of said storage area.
-
16. The method of claim 15, further comprising the step of:
responsive to none of said storage slots being available in said second part of the storage area, acquiring an unallocated storage slot in said first part of the storage area.
-
17. The method of claim 1, wherein the step of determining whether to allocate exclusive access comprises:
-
selecting each storage slot; and
determining whether each selected storage slot is owned by another process; and
wherein the step of acquiring all of said storage slots comprises;
responsive to a storage slot not being owned by another process, acquiring said storage slot; and
responsive to a selected storage slot being owned by another process, waiting until said storage slot is relinquished; and
responsive to a storage slot being relinquished, acquiring said storage slot.
-
-
18. The method of claim 1, wherein the step of acquiring all of said storage slots comprises:
-
acquiring, on at least one pass of the storage area, each storage slot not owned by another process; and
subsequent to the step of acquiring each unowned storage slot, selecting each remaining slot;
waiting until each remaining slot is relinquished; and
responsive to each remaining slot being relinquished, acquiring said relinquished slot.
-
-
19. The method of claim 1, wherein the step of acquiring all of said storage slots comprises:
-
informing a process requesting exclusive access as each allocated slot is relinquished; and
responsive to an allocated slot being relinquished, acquiring said relinquished slot.
-
-
20. The method of claim 1, wherein the step of a process requesting shared access acquiring one of said storage slots comprises the step of:
responsive to acquiring a storage slot, recording the position of said storage slot.
-
21. The method of claim 20, further comprising the step of:
-
responsive to said process no longer requiring shared access to the resource, relinquishing the slot denoting said process'"'"' shared access, said relinquishing step comprising;
using said recorded position to locate the storage slot to be relinquished.
-
-
22. The method of claim 4, comprising the step of:
-
responsive to said process no longer requiring shared access to the resource, relinquishing the slot denoting said process'"'"' shared access, wherein the step of relinquishing the slot denoting said process'"'"' shared access comprises;
selecting a storage slot;
determining whether a thread id associated with a thread requesting that said shared access be relinquished matches a thread id associated with the selected storage slot;
responsive to a match, relinquishing said selected storage slot; and
responsive to determining that there is no match, selecting storage slots until a match is achieved.
-
-
23. The method of claim 1, comprising the step of responsive to said process no longer requiring shared access to the resource, relinquishing the slot denoting said process'"'"' shared access.
-
24. The method of claim 23, wherein said step of relinquishing the slot denoting said process'"'"' shared access comprises:
searching one of a first part and a second part of the storage area for the slot denoting said process, shared access.
-
25. The method of claim 1, further comprising the step of:
responsive to a process no longer requiring exclusive access to the resource, relinquishing access to all of said storage slots.
-
26. A computer program product comprising computer program code recorded on a computer readable recording medium, which when executed on a computer, performs the method of claim 1.
-
27. Apparatus, having a storage, for controlling access by a plurality of concurrently operating processes to a resource, said apparatus comprising:
-
means for defining a predetermined number of slots within said storage;
means, responsive to a request by one of said processes for shared access to said resource, for determining whether to allocate shared access; and
means, responsive to a determination that shared access is to be allocated, for allocating said requesting process shared access, said means for allocating shared access comprising;
means for acquiring one of said storage slots; and
wherein said apparatus further comprises;
means, responsive to a request by one of said processes for exclusive access to said resource, for determining whether to allocate exclusive access; and
means, responsive to a determination that exclusive access is to be allocated, for allocating said requesting process exclusive access, said means for allocating exclusive access comprising;
means for acquiring all of said storage slots. - View Dependent Claims (28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51)
means for checking whether any one of a set of storage slots is unallocated; and
said means for allocating shared access comprises;
means, responsive to one of said set of storage slots being unallocated, for acquiring one of said unallocated slots.
-
-
29. The apparatus of claim 27, wherein the means for determining whether to allocate shared access comprises:
-
means for selecting a storage slot; and
means for determining whether said storage slot is owned by another process; and
wherein said means for allocating shared access comprises;
means, responsive to said storage slot not being owned by another process, for acquiring said selected storage slot.
-
-
30. The apparatus of claim 27, wherein each process comprises at least one thread having a unique thread id, each process indicating ownership of a storage slot by associating the thread id of the thread requesting access to said resource with said storage slot.
-
31. The apparatus of claim 27, wherein each process has priority information associated therewith.
-
32. The apparatus of claim 31, wherein the means for allocating shared access further comprises:
means, responsive to determining that a first storage slot is owned by another process, for performing an action based on the priority of said requesting process.
-
33. The apparatus of claim 32, wherein in response to the requesting process having a low priority, said means for performing an action comprises:
-
means for waiting for said first storage slot to be relinquished by said owning process; and
means, responsive to said first storage slot being relinquished, for acquiring said first storage slot.
-
-
34. The apparatus of claim 32, wherein in response to the requesting process having a high priority, said means for performing an action comprises:
-
means for selecting storage slots until an unallocated storage slot is selected; and
means, responsive to selecting an unallocated storage slot, for acquiring said unallocated storage slot.
-
-
35. The apparatus of claim 34, wherein no more than a predetermined number of storage slots are selected, said apparatus further comprising:
-
means, responsive to none of said selected storage slots being available, for waiting for the last of said selected slots to be relinquished by an owning process; and
means, responsive to the last of said selected slots being relinquished, for acquiring the last of said selected slots.
-
-
36. The apparatus of claim 27, wherein an input queue is associated with at least one of said storage slots.
-
37. The apparatus of claim 36, comprising means, responsive to determining that processes are queued on a selected storage slot, for selecting another storage slot.
-
38. The apparatus of claim 36, comprising:
means for ordering said queued processes according to priority information associated therewith.
-
39. The apparatus of claim 38, comprising:
means for moving a high priority process to the head of a queue.
-
40. The apparatus of claim 31, wherein a process requesting shared access and having a low priority selects a storage slot from a first part of said storage area.
-
41. The apparatus of claim 40, wherein a process requesting shared access and having a high priority selects a storage slot from a second part of said storage area.
-
42. The apparatus of claim 41, further comprising:
means, responsive to none of said storage slots being available in said second part of the storage area, for acquiring an unallocated storage slot in said first part of the storage area.
-
43. The apparatus of claim 27, wherein the means for determining whether to allocate exclusive access comprises:
-
means for selecting each storage slot; and
means for determining whether each selected storage slot is owned by another process; and
wherein the means for acquiring all of said storage slots comprises;
means, responsive to a selected storage slot not being owned by another process, for acquiring said storage slot; and
means, responsive to a selected storage slot being owned by another process, for waiting until said storage slot is relinquished; and
means, responsive to a storage slot being relinquished, for acquiring said storage slot.
-
-
44. The apparatus of claim 27, wherein the means for acquiring all of said storage slots comprises:
-
means for acquiring, on at least one pass of the storage area, each storage slot not owned by another process; and
means, responsive to the acquisition of all unowned storage slots, for selecting each remaining slot;
means for waiting until each remaining slot is relinquished; and
means, responsive to each remaining slot being relinquished, for acquiring said relinquished slot.
-
-
45. The apparatus of claim 27, wherein the means for acquiring all of said storage slots comprises:
-
means for informing a process requesting exclusive access as each allocated slot is relinquished; and
means, responsive to an allocated slot being relinquished, for acquiring said relinquished slot.
-
-
46. The apparatus of claim 27, wherein the means for a process requesting shared access acquiring one of said storage slots comprises:
means, responsive to acquiring a storage slot, for recording the position of said storage slot.
-
47. The apparatus of claim 46, further comprising:
-
means, responsive to said process no longer requiring shared access to the resource, for relinquishing the slot denoting said process'"'"' shared access, said relinquishing means comprising;
means for using said recorded position to locate the storage slot to be relinquished.
-
-
48. The apparatus of claim 30, comprising:
-
means, responsive to said process no longer requiring shared access to the resource, for relinquishing the slot denoting said process'"'"' shared access, wherein the means for relinquishing the slot denoting said process'"'"' shared access comprises;
means for selecting a storage slot;
means for determining whether a thread id associated with a thread requesting that said shared access be relinquished matches a thread id associated with the selected storage slot;
means, responsive to a match, for relinquishing said selected storage slot; and
means, responsive to determining that there is no match, for selecting storage slots until a match is achieved.
-
-
49. The apparatus of claim 27, comprising means, responsive to said process no longer requiring shared access to the resource, relinquishing the slot denoting said process'"'"' shared access.
-
50. The method of claim 49, wherein said means for relinquishing the slot denoting said process'"'"' shared access comprises:
means for searching one of a first part and a second part of the storage area for the slot denoting said process'"'"' shared access.
-
51. The apparatus of claim 27, further comprising:
means, responsive to a process no longer requiring exclusive access to the resource, for relinquishing access to all of said storage slots.
Specification