For Programmers: Free Programming Magazines  


Home > Archive > Tcl > June 2007 > unload state









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author unload state
rene

2007-06-28, 4:18 am

Hi,

I would like to change a used C-library in my running program. It
should be done with load/unload but...

* how can I detemine when the library is really detached and I can
again call load? In the documentation
I only found " When both reference counts have reached 0, the
library will be detached from the process.".
But how can I find this either on C or Tcl level.

* what is the preferred way to do a unload? Currently there is no API
in the "package" command.
May be something new like "package unload..."

rene

Matthias Kraft

2007-06-29, 8:08 am

rene schrieb:
> * how can I detemine when the library is really detached and I can
> again call load? In the documentation
> I only found " When both reference counts have reached 0, the
> library will be detached from the process.".
> But how can I find this either on C or Tcl level.


I don't about Windows or Mac, but for POSIX conforming systems have a
look at the dlopen()/dlclose() interfaces - and read very carefully.

You can't unload a C extension from Tcl up to and including 8.4. For
a possibility with 8.5 have a look here: http://wiki.tcl.tk/10852

> * what is the preferred way to do a unload? Currently there is no API
> in the "package" command.
> May be something new like "package unload..."


[package] is for Tcl packages. Plain Tcl packages can be forgotten:
package forget foo

kind regards
--
Matthias Kraft
Software AG, Germany
rene

2007-06-29, 8:08 am


Matthias Kraft schrieb:
> You can't unload a C extension from Tcl up to and including 8.4. For
> a possibility with 8.5 have a look here: http://wiki.tcl.tk/10852

Thanks for the link. I was not aware of the TIP 239 until now.


rene

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com