Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15784

Re: Multiple threads

Date 2011-11-16 13:30 -0500
From Dave Angel <d@davea.name>
Subject Re: Multiple threads
References (1 earlier) <CAPTjJmoAWni4-wyKB4HgAJ5KvTbz42_BC3f22MOnugUmmXzVtA@mail.gmail.com> <CAAdqOWF=irJXFO2q2+o8jpM09GMLf8N+NTNGTOtMhwKgtG6jag@mail.gmail.com> <4EC3F298.1030604@davea.name> <CAAdqOWFJftDH=9YaiHOk6mbqYGgLXK7zPEKcUhENqnzbFd2VNg@mail.gmail.com> <4EC3FF56.7030101@davea.name>
Newsgroups comp.lang.python
Message-ID <mailman.2778.1321468264.27778.python-list@python.org> (permalink)

Show all headers | View raw


On 11/16/2011 01:22 PM, Dave Angel wrote:
> (You're top-posting.  Put your remarks AFTER what you're quoting)
>
> On 11/16/2011 12:52 PM, Jack Keegan wrote:
>> Ok, I thought that processes would do the same job as threads. So 
>> would the
>> general rule be some thing like so:
>>
>> If I want another piece of work to run (theoretically) along side my 
>> main
>> script, and I want to share data between them, I should use a thread and
>> share data with the thread-safe queue.
>> If the work I want done can function and complete on its own, go for a
>> process.
>>
>> Would that be about right?
>>
>
> Yes, with all the caveats I mentioned before.  With some language 
> implementations, and with some operating systems, and on some 
> CPU-systems, the guidelines could be different.  They all trade off in 
> ways too complex to describe here.
>
> For example, if a thread is mostly doing I/O, it may be just as 
> efficient as a separate process, even if sharing data isn't an issue.
>
> And in some languages, sharing data between processes isn't all that 
> tough, either.
>
>
Well, you sent me a mail without including the list (just use 
Reply-All), and I tried to add the list in.  Unfortunately, I picked the 
wrong one, so i sent this to Tutor by mistake.  I'll try to fix that 
now, sorry.




-- 

DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Multiple threads Eduardo Oliva <dutche@gmail.com> - 2011-11-16 05:48 -0800
  Re: Multiple threads Chris Angelico <rosuav@gmail.com> - 2011-11-17 00:55 +1100
  Re: Multiple threads Henrik Faber <hfaber@invalid.net> - 2011-11-16 15:07 +0100
  Re: Multiple threads Christian Heimes <lists@cheimes.de> - 2011-11-16 16:01 +0100
  Re: Multiple threads Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-11-16 17:45 +0100
    Re: Multiple threads Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2011-11-16 16:38 -0800
  Re: Multiple threads Dave Angel <d@davea.name> - 2011-11-16 12:27 -0500
  Re: Multiple threads Michael Hunter <tahoemph@gmail.com> - 2011-11-16 09:55 -0800
  Re: Multiple threads Dave Angel <d@davea.name> - 2011-11-16 13:06 -0500
  Re: Multiple threads Dave Angel <d@davea.name> - 2011-11-16 13:30 -0500
  Re: Multiple threads Miki Tebeka <miki.tebeka@gmail.com> - 2011-11-16 12:50 -0800

csiph-web