Re: [Rd] Question about copying arguments in C.

2012-09-15 Thread Simon Knapp
OK I think I'm getting it, but one more question if I may... When I write a function, I don't protect the arguments explicitly (I understand that they should be protected within the calling function) - are my functions examples of functions that "protect their arguments"? Looking at the code for s

Re: [Rd] Risk of readRDS() not detecting race conditions with parallel saveRDS()?

2012-09-15 Thread Henrik Bengtsson
Hi Bill, yes, emulating atomic writing by writing to a temporary file and then renaming definitely lowers the risk for corruptions. I actually take a similar approach in the Aroma Project (aroma.affymetrix et al.), R.utils::saveObject(), R.utils::downloadFile() and more, and it provides a great p

Re: [Rd] Risk of readRDS() not detecting race conditions with parallel saveRDS()?

2012-09-15 Thread Henrik Bengtsson
On Sat, Sep 15, 2012 at 12:17 PM, Simon Urbanek wrote: > > On Sep 15, 2012, at 1:21 PM, Henrik Bengtsson wrote: > >> I hardly know anything about the format used in (non-compressed) >> serialization/RDS, but hoping someone with more knowledge could give >> me some feedback; >> >> Consider two R pr

Re: [Rd] Risk of readRDS() not detecting race conditions with parallel saveRDS()?

2012-09-15 Thread William Dunlap
Why not write the RDS file more atomically - write it to a temporary file and rename that file to its final name when it is completely written? E.g., saveRDS.atomically function (object, file, ...) { tfile <- tempfile(basename(file), dirname(file)) on.exit(if (file.exists(tfile)) unlink(

Re: [Rd] Risk of readRDS() not detecting race conditions with parallel saveRDS()?

2012-09-15 Thread Simon Urbanek
On Sep 15, 2012, at 1:21 PM, Henrik Bengtsson wrote: > I hardly know anything about the format used in (non-compressed) > serialization/RDS, but hoping someone with more knowledge could give > me some feedback; > > Consider two R processes running in parallel on the same unknown file > system.

Re: [Rd] Question about copying arguments in C.

2012-09-15 Thread Simon Urbanek
On Sep 15, 2012, at 2:57 PM, Simon Urbanek wrote: > > On Sep 15, 2012, at 11:28 AM, Simon Knapp wrote: > >> Hi Simon, >> >> Thanks for your advice, but I'm still not clear. In my case I don't >> want to modify the result - the integer acts as a handle for indexing >> an array in later calls ba

Re: [Rd] Question about copying arguments in C.

2012-09-15 Thread Simon Urbanek
On Sep 15, 2012, at 11:28 AM, Simon Knapp wrote: > Hi Simon, > > Thanks for your advice, but I'm still not clear. In my case I don't > want to modify the result - the integer acts as a handle for indexing > an array in later calls back into my library. > > As I understand it, returning result l

[Rd] [Repost 3/3] Minor glitch in 'Writing R Extensions'

2012-09-15 Thread Dirk Eddelbuettel
[ Email repost 3 of 3 ] From: Dirk Eddelbuettel To: R-devel org Subject: [Patch] Minor glitch in 'Writing R Extensions' Date: Mon, 3 Sep 2012 10:58:32 -0500 The (marked up in info mode) manual Writing R Extensions says in 6.1.3 -- Function: double fprec (double X, double D

[Rd] Reposting mails to R-Core / R-Devel

2012-09-15 Thread Dirk Eddelbuettel
Over the last few months, I had sent emails with follow-up suggestions, questions and (minimal) patches to R Core (two) and R-Devel (one). Not one of these emails was met with any follow-up I am aware of. I will resend them here so that they will at least get archived in case someone else ponder

[Rd] [Repost 2/3] Why fix all.equal for POSIXct at 1 msec?

2012-09-15 Thread Dirk Eddelbuettel
[ Email repost 2 of 3 ] From: Dirk Eddelbuettel To: R-core , Prof Brian D Ripley Subject: Why fix all.equal for POSIXct at 1 msec? Date: Sat, 28 Jul 2012 10:29:52 -0500 In R-devel as of today, the following simple loop edd@max:~/svn/r-devel$ ~/bin/R-devel.sh R Under d

[Rd] [Repost 1/3] The X11 device patch

2012-09-15 Thread Dirk Eddelbuettel
[ Email resend 1 of 3 ] From: Dirk Eddelbuettel To: R-core CC: Philip Johnson , e...@debian.org Subject: The X11 device patch Date: Wed, 27 Jun 2012 11:53:13 -0500 R Core, *Great* to see this bubble up in the NEWS aggregation: 2.15.1 patched NEW FEATURES The

Re: [Rd] methods cbind2 bind_activation disrupts cbind everywhere

2012-09-15 Thread Martin Morgan
On 09/14/2012 07:16 AM, Jeff Ryan wrote: Refreshing the memory on performance: http://r.789695.n4.nabble.com/reduce-limit-number-of-arguments-in-methods-cbind-td921600.html#a921601 short comment below... My issue had been resolved by a more careful approach taken by timeSeries. The other o

[Rd] Risk of readRDS() not detecting race conditions with parallel saveRDS()?

2012-09-15 Thread Henrik Bengtsson
I hardly know anything about the format used in (non-compressed) serialization/RDS, but hoping someone with more knowledge could give me some feedback; Consider two R processes running in parallel on the same unknown file system. Both of them write and read to the same RDS file foo.rds (without c

Re: [Rd] Question about copying arguments in C.

2012-09-15 Thread Simon Knapp
Hi Simon, Thanks for your advice, but I'm still not clear. In my case I don't want to modify the result - the integer acts as a handle for indexing an array in later calls back into my library. As I understand it, returning result like SEXP func(SEXP arg) {return arg;} would not copy arg and he

Re: [Rd] Question about copying arguments in C.

2012-09-15 Thread Simon Urbanek
On Sep 14, 2012, at 11:10 PM, Simon Knapp wrote: > Hi List, > > I'd imagine this is a question that has been answered before, but I > can't seem to track it down, sorry for the duplication if it has. > > I am writing an interface for a C library and want to return an S4 > class from the 'constr