首页> 外国专利> 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.
机译:提供了一种用于管理多线程计算机程序的线程如何共享资源的方法和装置。通过授予线程拥有与资源相关联的锁的权限,程序的一个线程比程序的其他线程具有优先权,而与线程当前是否需要使用资源无关。其他线程旨在在需要使用资源时指示优先级线程。如果优先线程是使用资源完成的,并且检测到另一个线程正在等待使用资源,则优先线程将释放资源的资源锁。释放资源锁定后,优先级线程会自动请求资源锁定。使用资源后,如果优先级线程已请求资源,则任何非优先级线程都将资源锁定释放到优先级线程,而与其他线程是否在等待资源无关。根据一个实施例,使用计时器机制来使优先级线程定期检查是否有任何线程正在等待使用资源。

著录项

  • 公开/公告号EP0783152B1

    专利类型

  • 公开/公告日2006-11-08

    原文格式PDF

  • 申请/专利权人 SUN MICROSYSTEMS INC;

    申请/专利号EP19960309241

  • 发明设计人 CLARK PETER D.;

    申请日1996-12-18

  • 分类号G06F9/46;

  • 国家 EP

  • 入库时间 2022-08-21 21:32:19

相似文献

  • 专利
  • 外文文献
  • 中文文献
获取专利

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号