[Rd] There was a problem by the use of snow.

From: Ei-ji Nakama <nakama_at_ki.rim.or.jp>
Date: Mon, 25 Jun 2007 01:11:10 +0900


problem of the very large memory require by the Sign extension.

 static void resize_buffer(membuf_t mb, int needed)  {
- int newsize = 2 * needed;
+ size_t newsize = 2 * needed;

     mb->buf = realloc(mb->buf, newsize);
     if (mb->buf == NULL)
        error(_("cannot allocate buffer"));


The time-out of read and write was not set.

51:sendData.SOCKnode <- function(node, data) {
52:     timeout <- getClusterOption("timeout")
53:     old <- options(timeout = timeout);
54:     on.exit(options(old))
55:     serialize(data, node$con)
56: }
57:
58:recvData.SOCKnode <- function(node) {
59:     timeout <- getClusterOption("timeout")
60:     old <- options(timeout = timeout);
61:     on.exit(options(old))
62:     unserialize(node$con)
63: }



--- R-2.5.0.orig/src/modules/internet/sockconn.c        2006-09-04
23:20:59.000000000 +0900

+++ R-2.5.0/src/modules/internet/sockconn.c 2007-06-25
00:51:38.000000000 +0900
@@ -155,14 +155,19 @@
 static size_t sock_read(void *ptr, size_t size, size_t nitems,
                        Rconnection con)
 {
+ int timeout = asInteger(GetOption(install("timeout"), R_BaseEnv));
+
+ R_SockTimeout(timeout);

     return sock_read_helper(con, ptr, size * nitems)/size;  }

 static size_t sock_write(const void *ptr, size_t size, size_t nitems,

                         Rconnection con)
 {
+ int timeout = asInteger(GetOption(install("timeout"), R_BaseEnv));

     Rsockconn this = (Rsockconn)con->private;

+ R_SockTimeout(timeout);

     return R_SockWrite(this->fd, ptr, size * nitems)/size;  }

-- 
EI-JI Nakama  <nakama_at_ki.rim.or.jp>
"\u4e2d\u9593\u6804\u6cbb"  <nakama_at_ki.rim.or.jp>

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sun 24 Jun 2007 - 16:15:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 25 Jun 2007 - 11:35:33 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.