[sv-cc] Handle lifetimes for one-time callbacks

From: Jim Vellenga <vellenga_at_.....>
Date: Wed Mar 12 2008 - 11:05:09 PDT
I asked an ex-VPI developer at Cadence who once served on the 1364 PLI 
Task Force about handle lifetimes for one-time callbacks such as 
cbReadWriteSynch.  What he said (and presumably what NC and Verilog-XL 
have implemented) is

-- The routine vpi_register_cb() always returns a handle to the 
callback.  If the application does not intend to use the handle again 
later, it should call vpi_free_object() to release the handle.

-- When the one-time callback triggers, the callback is removed, but 
the handle, if not already released, persists.  The application should 
call vpi_free_object(), if necessary, to release the handle.

-- If the application calls vpi_remove_cb() before the callback has 
triggered, vpi_remove_cb() both removes the callback and releases the 
handle.

-- It is an error for the application to call vpi_remove_cb() with a 
handle to a one-time callback that has already triggered.

Regards, 
Jim Vellenga

--------------------------------------------------------- 
James H. Vellenga                            978-262-6381 
Software Architect                     (FAX) 978-262-6636 
Cadence Design Systems, Inc.         vellenga@cadence.com 
270 Billerica Rd
Chelmsford, MA 01824-4179
"We all work with partial information." 
---------------------------------------------------------- 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Wed Mar 12 11:07:06 2008

This archive was generated by hypermail 2.1.8 : Wed Mar 12 2008 - 11:07:22 PDT