Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] blech... (multijob/multiprocessing work-around for cygwin)
Date: Mon, 24 Sep 2012 18:06:23
Message-Id: 50608585.2070009@gentoo.org
In Reply to: [gentoo-portage-dev] blech... (multijob/multiprocessing work-around for cygwin) by "Gregory M. Turner"
1 On 09/24/2012 03:25 AM, Gregory M. Turner wrote:
2 > +# try real hard to figure out if this is a cygwin host; cache results.
3 > +this_host_is_cygwin() {
4 > + if [[ -n ${_this_host_is_cygwin} ]] ; then
5 > + return $_this_host_is_cygwin
6 > + fi
7 > + [[ -x ${EPREFIX}/usr/bin/uname ]] && \
8 > + [[ $( ${EPREFIX}/usr/bin/uname -o 2>/dev/null ) == Cygwin* ]] && \
9 > + export _this_host_is_cygwin=0 && return 0
10
11 You could probably just assume that uname is in $PATH and remove all the
12 other tests.
13
14 > multijob_finish_one() {
15 > local pid ret
16 > - read -r -u ${mj_control_fd} pid ret
17 > + multijob_assert
18 > + if this_host_is_cygwin ; then
19 > + read -r pid ret < ${mj_control_pipe}
20 > + else
21 > + read -r -u ${mj_control_fd} pid ret
22 > + fi
23 > : $(( --mj_num_jobs ))
24 > return ${ret}
25 > }
26 Since you re-open the pipe for each read, there's a race condition which
27 I've explained here:
28
29 http://permalink.gmane.org/gmane.linux.gentoo.devel/77528
30 --
31 Thanks,
32 Zac

Replies

Subject Author
Re: [gentoo-portage-dev] blech... (multijob/multiprocessing work-around for cygwin) "Gregory M. Turner" <gmt@×××××.us>