similar to: reg.finalizer and connection gc -- which runs when (and why)?

Displaying 20 results from an estimated 8000 matches similar to: "reg.finalizer and connection gc -- which runs when (and why)?"

2014 Oct 27
1
proper use of reg.finalizer to close connections
Hi all, I have a question about finalizers... I have a package that manages state for a few connections, and I'd like to ensure that these connections are 'cleanly' closed upon either (i) R quitting or (ii) an unloading of the package. So, in a pared-down example package with a single R file, it looks something like: ##### BEGIN PACKAGE CODE ##### .CONNS <- new.env(parent =
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 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
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")
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
2017 Mar 12
2
USB card reader causing qemu-kvm SEGV's
Hi. I have a Supermicro 5018D-FN4T (Xeon D-1541 based SBC) that I use for virtualization. I?m running Centos 7.3 on it (updated), with the CentOS-QEMU-EV.repo repository as the source for virtualization packages. I run an Ubuntu 16.04-2 guest VM on it, which is ordinary enough. What?s perhaps less ordinary is that I?ve attached a Lexar Media, Inc. ?Lexar Professional Workflow CR1 CFast 2.0 USB
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 Sep 22
1
Managing a list with a list
OK. Another amateur question. I have a list with attributes on pine trees, like the stem's location, a logical value set to T if it's alive, some parameters for growth, diameter, etc. The tree list has another list in it which is a new data type for me. I want to make a new list that retains all the live trees. That is where Living == T. Here's the summary of the list: >
2010 Aug 21
1
Speed improvement to evalList
I've been inspired to look at the R source code by some strange timing results that I wrote about on my blog at radfordneal.wordpress.com (see the posts on "Speeding up parentheses..." and "Two surprising things...". I discovered that the strange speed advantage of curly brackets over parentheses is partially explained by an inefficiency in the evalList and
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
2018 May 15
2
centos-qemu-ev repository not work for x86_64 arch on CentOS 7.5
Hello, Sandro! On 11.05.2018 12:19, Sandro Bonazzola wrote: > Sadly, the new qemu-kvm-ev we prepared for CentOS 7.5 didn't get released ( > https://bugs.centos.org/view.php?id=14764) but the new build is ready. After installing CentOS 7.5 and installing package qemu-kvm-ev I can't install KVM on x86_64 arch: command "yum -y install perf qemu-kvm-ev qemu-kvm-tools-ev
2009 Oct 22
1
loop vs. apply(): strange behavior with data frame?
Hi everybody, I noticed a strange behavior when using loops versus apply() on a data frame. The example below "explicitly" computes a distance matrix given a dataset. When the dataset is a matrix, everything works fine. But when the dataset is a data.frame, the dist.for function written using nested loops will take a lot longer than the dist.apply ######## USING FOR ####### dist.for
2005 Nov 28
1
terms.object documentation bug? (PR#8353)
Full_Name: simon wood Version: 2.2.0 (and lower) OS: linux/windows Submission from: (NULL) (86.135.153.59) I think that the documentation for the `specials' attribute of a `terms.object' is not quite right: specials: If the 'specials' argument was given to 'terms.formula' there is a 'specials' attribute, a list of vectors indicating the terms
2015 Oct 27
2
Differences between qemu-kvm and qemu-kvm-ev
Sandro, Could you please enumerate the actual technical differences between stock qemu-kvm and qemu-kvm-ev? For example, what could one do with qemu-kvm-ev that cannot with qemu-kvm? Lucian -- Sent from the Delta quadrant using Borg technology! Nux! www.nux.ro ----- Original Message ----- > From: "Sandro Bonazzola" <sbonazzo at redhat.com> > To: "Discussion about
2007 Jan 08
2
Contrasts for ordered factors
Dear all, I do not seem to grasp how contrasts are set for ordered factors. Perhaps someone can elighten me? When I work with ordered factors, I would often like to be able to reduce the used polynomial to a simpler one (where possible). Thus, I would like to explicetly code the polynomial but ideally, the intial model (thus, the full polynomial) would be identical to one with an ordered factor.
2007 Oct 01
1
[nls] singular gradient
Hi, I am new to R. I don't have strong background of statistics. I am a student of Geotechnical Engineering. I tried to run a nonlinear regression for a three-variable function, that is N = f(CSR, ev) # N is a function of CSR and ev, and N = CSR/(A +B*CSR), wherer (A,B) are function of ev. N, CSR and ev are observed in the experiments. Following is my R script. rm(list=ls())
2010 Nov 15
1
Aggregate on identical link attributes
Hello R community, I need to do some aggregation based on the test data below. The below code works ok, but when its applied to my real data which includes over 9,000 records the process runs for over an hour. I know there is a more efficient way of doing this. I want to Sum the below data's volumes where FNODE and TNODE match, i.e. FNODE=1 and TNODE =20 -> Volume=100 ,
2007 Aug 22
3
Help with vector gymnastics
Hello, What is the best way of solving this problem? answer <- ifelse(tf=TRUE, i * 5, previous answer) where as an initial condition tf[1] <- TRUE For example if, tf <- c(T,F,F,F,T,T,F) over i = 1 to 7 then the output of the function will be answer = 5 5 5 5 25 30 30 Thank you. Phil,
2006 Apr 28
2
entries that match a regexp
Hi all, I am trying to filter the element of a df that start with "TF", like this: alfa = c(123221,"TF13124",41243,"TF1234",32414,"TF13124","TF14333",2134123,"TF1234") beta =
2009 Jul 16
2
[PATCH server] updated anyterm/ovirt integration
host static anyterm content locally, url parameterize anyterm rows/cols/general param update spec/makefile Ideally I wanted and tried hard to put all this into a seperate ovirt-server--anyterm subpackage, but we cannot 'reopen' the ovirt server virtual host defined in ovirt-server.conf to add the neccessary rewrite rules. it would be nice to figure out a way to do this ---