Re: [Tutor] multiprocessing question

2014-11-28 Thread eryksun
On Fri, Nov 28, 2014 at 3:24 AM, Cameron Simpson wrote: > > With multiprocessing they're completely separate (distinct memory spaces); > data > must be passed from one to the other, and there's a cost for that. Single-machine IPC can use shared memory, not just message passing via pipes and sock

Re: [Tutor] multiprocessing question

2014-11-28 Thread eryksun
On Thu, Nov 27, 2014 at 2:40 PM, Albert-Jan Roskam wrote: > >>CsvIter._get_row_lookup should work on a regular file from built-in >>open (not codecs.open), opened in binary mode. I/O on a regular file >>will release the GIL back to the main thread. mmap objects don't do >>this. > > Will io.open al

Re: [Tutor] multiprocessing question

2014-11-28 Thread Dave Angel
On 11/28/2014 05:53 AM, Albert-Jan Roskam wrote: - Original Message - From: Dave Angel To: tutor@python.org Cc: Sent: Thursday, November 27, 2014 11:55 PM Subject: Re: [Tutor] multiprocessing question On 11/27/2014 04:01 PM, Albert-Jan Roskam wrote: I made a comparison betwe

Re: [Tutor] multiprocessing question

2014-11-28 Thread Albert-Jan Roskam
- Original Message - > From: Dave Angel > To: tutor@python.org > Cc: > Sent: Thursday, November 27, 2014 11:55 PM > Subject: Re: [Tutor] multiprocessing question > > On 11/27/2014 04:01 PM, Albert-Jan Roskam wrote: >> >> >> >> >> >> I made a comparison between multiprocessing an

Re: [Tutor] multiprocessing question

2014-11-28 Thread Dave Angel
On 11/27/2014 05:55 PM, Dave Angel wrote: On 11/27/2014 04:01 PM, Albert-Jan Roskam wrote: for line in self.data: if not line: break local_lookup.append(record_start) if len(local_lookup) > 100: self.lookup.exte

Re: [Tutor] multiprocessing question

2014-11-28 Thread Cameron Simpson
On 27Nov2014 17:55, Dave Angel wrote: On 11/27/2014 04:01 PM, Albert-Jan Roskam wrote: I made a comparison between multiprocessing and threading. In the code below (it's also here: http://pastebin.com/BmbgHtVL, multiprocessing is more than 100 (yes: one hundred) times slower than threading!

Re: [Tutor] multiprocessing question

2014-11-28 Thread Cameron Simpson
On 27Nov2014 20:40, Albert-Jan Roskam wrote: From: eryksun Binary mode ensures the offsets are valid for use with the mmap object in __getitem__. This requires an ASCII compatible encoding such as UTF-8. What do you mean exactly with "ascii compatible"? Does it mean 'superset of ascii', s