similar to: proper use of reg.finalizer to close connections

Displaying 20 results from an estimated 1000 matches similar to: "proper use of reg.finalizer to close connections"

2011 Apr 02
0
reg.finalizer(): Multiple finalizers?
Hi, I've got some questions regarding finalizers registered using reg.finalizer(). I have a setup where in certain cases I wish to set a new finalizer to an object that already got one. Since there is no API for removing/replacing already registered finalizers (have been "requested" previously on this list), I have basically just added a new finalizer by calling reg.finalizer() a
2016 Sep 15
1
Finalizer execution order question
Given an externalptr object 'pool' which protects an R object 'prot': # SEXP prot = (a dynamically updated list with handles) SEXP pool = R_MakeExternalPtr(p, R_NilValue, prot); R_RegisterCFinalizerEx(pool, fin_pool, TRUE); WRE explains that 'prot' remains in existence as long as 'pool' is around. Does this also mean 'prot' still exists when the
2011 Jul 22
1
reg.finalizer and connection gc -- which runs when (and why)?
With this set-up options(warn = 1) tf <- tempfile() finalizer <- function(obj) { message("finalizer") close(obj$f) } this code works ev <- new.env() ev$f <- file(tf, "w") reg.finalizer(ev, finalizer) rm(ev) gc() whereas this (reversing the order of file() and reg.finalizer()) ev <- new.env() reg.finalizer(ev, finalizer) ev$f <- file(tf,
2020 Apr 03
4
The finalizer of the externalPtr does not work when closing R?
Hi all, I found that the finalizer of the externalPtr is not called when R is quitting. However, manually calling GC() works fine. This behavior is observed on devel R 2020-04-02 r78142 on Win and R 3.6.3 on Ubuntu. I make a reproducible package here: https://github.com/Jiefei-Wang/example Here is the detail of how to reproduce the problem, I create a temporary file in the package root path and
2013 Oct 13
0
reg.finalizer(): Is it safe for the finalizer function to attach/load a package?
>From the help/docs it is pretty clear that one could/should only assume that the 'base' namespace is available when a finalizer function is evaluated. What is not clear to me is whether you can safely attach/load packages in your finalizer function. For example, are the following finalizer functions safe? reg.finalizer(e, function(e, ...) { library("tcltk")
2019 Jun 08
2
Determining the exit code of an "almost finished" R script
On Sat, Jun 8, 2019 at 2:13 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote: > > On 08/06/2019 7:42 a.m., Gergely Dar?czi wrote: > > Dear All, > > > > I'm using "reg.finalizer" in a function that is to be called in R scripts > > to do some cleanup on success. I have not found a way to run the function > > only if the script run without
2012 Nov 13
3
Bug#693154: xen-hypervisor-4.0-amd64: Xen "map irq failed" with Intel igb driver and 82576 quad port nic
Package: xen-hypervisor-4.0-amd64 Version: 4.0.1-5.4 Severity: important When using the the intel igb driver from the 3.2.0-0.bpo.4-amd64 kernel and debian squeeze hypervisor with a Intel 82576 quad port nic the first nic fails to get an IRQ mapping: relevant lines from dmesg ----8<---- [ 24.264857] Intel(R) Gigabit Ethernet Network Driver - version 3.2.10-k [ 24.264929] Copyright (c)
2020 Apr 03
0
The finalizer of the externalPtr does not work when closing R?
See R_RegisterCFinalizerEx() and set onexit to nonzero. Here: https://github.com/wch/r-source/blob/9353ddfa8d30069ad8975e0364307d710f2488d5/src/include/Rinternals.h#L1279-L1280 Gabor On Fri, Apr 3, 2020 at 1:56 PM Wang Jiefei <szwjf08 at gmail.com> wrote: > > Hi all, > > I found that the finalizer of the externalPtr is not called when R is > quitting. However, manually
2020 Apr 03
0
[External] The finalizer of the externalPtr does not work when closing R?
Use R_RegisterFinalizerEx in your C code. See https://cran.r-project.org/doc/manuals/r-release/R-exts.html#External-pointers-and-weak-references This still gives you only "best effort"; for anything stronger you would need a different approach. In general, finalizers should only be used as a backstop, not as a primary resource management tool (in R or any other garbage-collected
2003 Jun 20
6
How can convert user expired days in human readable ?
Hello all, On my system, some users have expire day user settings. I write a (python) script then parse the: 7.th selection in the master.passwd blabla:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:1064005200:xxxx:xxxx:xxxx:xxxx How can I conver the number like 1064005200 to human readable date format ? Or, there is a way to collect the information from a command interactively ? Regards, Murat Ustuntas
2013 Feb 13
2
stopping finalizers
Is there some way to prevent finalizers running during a section of code? I have a package that includes R objects linked to database tables. To maintain the call-by-value semantics, tables are copied rather than modified, and the extra tables are removed by finalizers during garbage collection. However, if the garbage collection occurs in the middle of processing another SQL query (which is
2005 Jul 26
1
Error registering finalizer
What exactly is a reference object? I'm getting this error message attempting to register a finalizer: can only weakly reference/finalize reference objects I don't see any problem with the code... Here's what appears to be the relevant portions. setClass("PDNNObject", representation(handle = "externalptr", id =
2003 Apr 09
5
httpd exited on signal 11
Hello Folks, I have used FreeBSD-4.8-RC and apache 1.3.2x. In some days,my dmesg has shown as the lines; pid 9229 (httpd), uid 80: exited on signal 11 pid 10106 (httpd), uid 80: exited on signal 11 pid 9842 (httpd), uid 80: exited on signal 11 pid 35708 (httpd), uid 80: exited on signal 11 pid 9371 (httpd), uid 80: exited on signal 11 pid 10337 (httpd), uid 80: exited on
2016 Aug 06
1
vector finalizers
Dear R Devel, In a thread this morning Luke Tierney mentioned that R's way of garbage collecting is going to change soon in 3.4.0. I couldn't find this info on Google but I wanted to share what I had been discussing in another forum, in case now is not too late to raise considerations which could affect the design of planned changes to R's garbage collection facilities. I ran into a
2001 Jul 10
1
Object finalization
I see some code in R to attach finalizers to external pointer references (Register[C]Finalizer). Anyone have an example of how to code the finalizer? R_RegisterCFinalizer accepts a C function, but I can't see how to get it to operate on the pointer, since the pointer is not passed to the function when its called. RegisterFinalizer takes an R closure, but how is it called from R (tried
2019 Jun 08
0
Determining the exit code of an "almost finished" R script
On 08/06/2019 9:55 a.m., Gergely Dar?czi wrote: > On Sat, Jun 8, 2019 at 2:13 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote: >> >> On 08/06/2019 7:42 a.m., Gergely Dar?czi wrote: >>> Dear All, >>> >>> I'm using "reg.finalizer" in a function that is to be called in R scripts >>> to do some cleanup on success. I have not
2018 Mar 27
1
Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism
2018-03-27 11:11 GMT+02:00 Tomas Kalibera <tomas.kalibera at gmail.com>: > On 03/27/2018 09:51 AM, I?aki ?car wrote: >> >> 2018-03-27 6:02 GMT+02:00 <luke-tierney at uiowa.edu>: >>> >>> This has nothing to do with printing or dispatch per se. It is the >>> result of an internal register (R_ReturnedValue) being protected. It >>> gets
2003 Jun 13
1
Gigabit Ethernet Security With Ipfilter
Hello all, I want to learn about requirements if I want to protect gigabit network with ipfilter as transparent firewall. Which type of hardware is required to install FreeBSD + ipf (as transparancy ) . We use 3 gigabit ethernet to protection which type of gigabit ethernet carts are powerfull. Also, what about the NMBCLUSTERS , IPSTATE_SIZE and IPSTATE_MAX in ip_state.h. I want to collect all
2010 Sep 01
2
user permissions
Hello, I have a problem about reaching my share folder when the permission is 750 but whenever I change it to 755 I can see the content of the folder. for 750 I get this result: "smbclient //serverip/sharename -U username" smb: \> ls NT_STATUS_NETWORK_ACCESS_DENIED listing \* 0 blocks of size 0. 9 blocks available smb: \> but for 755 everything is fine but of
2007 Jun 20
2
Forcing Dial application to skip if called server is unreachable
Is it possible to force the Dial function to skip to the next priority if it doesn't find the server of the called contact within a few seconds? I know I can use: Dial(Technology/resource[&Tech2/resource2...][|timeout][|options][|URL]) where I can use some short timeout in the "timeout" option, but if I do so, when some call is well succeeded, it will only ring for that