You cannot currently cancel a pending request for a mutex semaphore via 
the SEM service.  However, last year we had a similar request for STAF's 
ResPool (Resource Pool) service where a user wanted to be able to cancel a 
pending request for a resource so we asked him to open a STAF feature 
request and we implemented this by adding a new CANCEL request to the 
ResPool service.  So, open a new STAF feature request to add the ability 
to cancel a pending request for a mutex semaphore (our implementation of 
this will be very similar).  You can open a new STAF feature request via 
the STAF home page at http://staf.sourgeforge.net and select "Request New 
Feature" from the menu bar at the left.

As a possible workaround to use now, you could possibly use STAF's ResPool 
(Resource Pool) service instead of a mutex semaphore via the SEM service 
to control access to your shared resource.  See section "8.14 Resource 
Pool (ResPool) Service" in the STAF User's Guide at 
http://staf.sourceforge.net/current/STAFUG.htm#HDRRESSRV for more 
information.  To use it you would create a resource pool (via a CREATE 
POOL request) and then add a unique resource entry to the pool (via a ADD 
request), and then use the REQUEST ENTRY request to request the entry (if 
the resource is already owned, the request is added to its pending request 
list to wait for the resource entry to be released) and use the RELEASE 
ENTRY request to release the entry.  You can use its CANCEL request to 
cancel a pending request for a resource pool entry.  By default, it 
cancels the last pending request in the Pending Requests list (which is 
sorted in ascending order by priority, and then by the request timestamp) 
that was submitted by the same STAF handle/machinhe submitting the CANCEL 
request.  You may specify additional selection criteria (such as machine, 
handle number or name, entry, priority, or first) to specify to cancel a 
different pending request.

--------------------------------------------------------------
Sharon Lucas
IBM Austin,   luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313




From:   "Hernandez, Alejandro" <ajhernan...@ti.com>
To:     "staf-users@lists.sourceforge.net" 
<staf-users@lists.sourceforge.net>
Date:   02/04/2011 11:06 AM
Subject:        [staf-users] Cancelling a pending request to sem mutex



Hi,
 
I am trying to write a STAF based Java program that allows the users to 
gain access to a shared resource, I am thinking of controlling the access 
to the shared resource using a mutex implemented with Staf’s SEM service. 
One feature I would like to include in the program is the ability to 
cancel a request for the shared resource. Right now if another user 
already has access to the resource the program blocks on the REQUEST MUTEX 
<Name> call waiting for the mutex to be released, however If the user 
decides not to wait for the resource and clicks the cancel button I am not 
able to cancel the pending request to the mutex, Is there any way of doing 
this?
 
Thanks and regards,
Alejandro
------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical 
server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users


------------------------------------------------------------------------------
The modern datacenter depends on network connectivity to access resources
and provide services. The best practices for maximizing a physical server's
connectivity to a physical network are well understood - see how these
rules translate into the virtual world? 
http://p.sf.net/sfu/oracle-sfdevnlfb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users

Reply via email to