Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #63406 > unrolled thread
| Started by | Cameron Simpson <cs@zip.com.au> |
|---|---|
| First post | 2014-01-07 13:45 +1100 |
| Last post | 2014-01-07 13:45 +1100 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Trying to wrap my head around futures and coroutines Cameron Simpson <cs@zip.com.au> - 2014-01-07 13:45 +1100
| From | Cameron Simpson <cs@zip.com.au> |
|---|---|
| Date | 2014-01-07 13:45 +1100 |
| Subject | Re: Trying to wrap my head around futures and coroutines |
| Message-ID | <mailman.5115.1389062734.18130.python-list@python.org> |
On 07Jan2014 13:29, I wrote:
> def do_A():
> with lock_B():
> with lock_A():
> _do_A()
Um, of course there would be a cancel_B() up front above, like this:
def do_A():
cancel_B()
with lock_B():
with lock_A():
_do_A()
I'm with MRAB: you don't really need futures unless you looking to
move to a multithreaded appraoch and aren't multithreaded already.
Even then, you don't need futures, just track running threads and
what's meant to run next.
You can do all your blocking with Locks fairly easily unless there
are complexities not yet revealed. (Of course, this is a truism,
but I mean "conveniently".)
Cheers,
--
Cameron Simpson <cs@zip.com.au>
Follow! But! Follow only if ye be men of valor, for the entrance to this cave
is guarded by a creature so foul, so cruel that no man yet has fought with it
and lived! Bones of four fifty men lie strewn about its lair. So,
brave knights, if you do doubt your courage or your strength, come no
further, for death awaits you all with nasty big pointy teeth.
- Tim The Enchanter
Back to top | Article view | comp.lang.python
csiph-web