From dtenenba at fredhutch.org  Sat Aug 15 06:22:58 2015
From: dtenenba at fredhutch.org (Dan Tenenbaum)
Date: Fri, 14 Aug 2015 21:22:58 -0700 (PDT)
Subject: [Rd] Why not pthreads on Windows in 'parallel' package?
In-Reply-To: <CAFDcVCTnLnkkDcYUDUwu6rt8NzSrKY-EZz0zXX4KroATsZE_7g@mail.gmail.com>
Message-ID: <193949076.936118.1439612578782.JavaMail.root@fredhutch.org>

I'm confused; mclapply does not work on windows (at least with mc.cores > 1) because fork() is not available on windows.
So the original question still seems relevant to me. 
Dan


----- Original Message -----
> From: "Henrik Bengtsson" <henrik.bengtsson at ucsf.edu>
> To: "Kasper Daniel Hansen" <kasperdanielhansen at gmail.com>
> Cc: "R-devel" <r-devel at r-project.org>
> Sent: Friday, August 14, 2015 8:16:33 PM
> Subject: Re: [Rd] Why not pthreads on Windows in 'parallel' package?
> 
> Aaaah ...
> 
> and argh - I should have better not to post R question at midnight,
> especially when I know it forks the process and it's not using
> threads.
> Brain meltdown. (So, we'll proceed trying to use pthreads in
> matrixStats
> also for Windows). Sorry for the noise and thanks Kasper.
> 
> Henrik
> On Aug 15, 2015 02:52, "Kasper Daniel Hansen"
> <kasperdanielhansen at gmail.com>
> wrote:
> 
> > mclapply uses fork which is different from pthreads.  As I
> > understand it,
> > pthreads requires you to rewrite code, fork is a system call which
> > takes
> > care of completely replicating the current state of the process.
> >
> > Kasper
> >
> > On Fri, Aug 14, 2015 at 5:00 PM, Henrik Bengtsson <
> > henrik.bengtsson at ucsf.edu> wrote:
> >
> >> On Windows there are a few 'pthreads' implementation, e.g.
> >> pthreads-w32 and winpthreads
> >> [
> >> https://cran.r-project.org/doc/manuals/r-devel/R-exts.html#Using-pthreads
> >> ].
> >> We're thinking of giving them a try for the matrixStats package,
> >> and
> >> basic tests indicates it works, but since Windows pthreads are not
> >> used by core R (or?) I've got a little bit worried that we will
> >> face
> >> overwhelming problems.
> >>
> >> So, why are the above Windows implementations not used in the
> >> 'parallel' package in order to add multicore support for
> >> mclapply() on
> >> Windows?  Was it tried but found to be unreliable?  Was it that no
> >> one
> >> had the time to do it?  License issues?  Are there any pointers to
> >> old
> >> R-devel threads discussing this?
> >>
> >> Thanks
> >>
> >> Henrik
> >>
> >> ______________________________________________
> >> R-devel at r-project.org mailing list
> >> https://stat.ethz.ch/mailman/listinfo/r-devel
> >>
> >
> >
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>



[Rd] Why not pthreads on Windows in 'parallel' package?
Dan Tenenbaum