首页>
外国专利>
Method and apparatus for automatically managing concurrent access to a shared resource in a multi-threaded programming environment
Method and apparatus for automatically managing concurrent access to a shared resource in a multi-threaded programming environment
展开▼
机译:在多线程编程环境中自动管理对共享资源的并发访问的方法和装置
展开▼
页面导航
摘要
著录项
相似文献
摘要
A method and apparatus for managing how threads of a multi-threaded computer program share a resource is provided. One thread of the program is given priority over other threads of the program by granting to the thread possession of the lock associated with the resource regardless of whether the thread currently requires use of the resource. The other threads are designed to indicate to the priority thread when they require use of the resource. If the priority thread is done using the resource and detects that another thread is waiting to use the resource, the priority thread releases the resource lock for the resource. After releasing the lock for the resource, the priority thread automatically requests the resource lock. After using the resource, any non-priority thread releases the resource lock to the priority thread if the priority thread has requested the resource, without regard to whether any other threads may be waiting for the resource. According to one embodiment, a timer mechanism is used to cause the priority thread to periodically check whether any threads are waiting to use the resource.
展开▼