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


Groups > comp.lang.python > #102200 > unrolled thread

Re: Question about asyncio and blocking operations

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2016-01-28 17:20 -0700
Last post2016-01-28 17:20 -0700
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.


Contents

  Re: Question about asyncio and blocking operations Ian Kelly <ian.g.kelly@gmail.com> - 2016-01-28 17:20 -0700

#102200 — Re: Question about asyncio and blocking operations

FromIan Kelly <ian.g.kelly@gmail.com>
Date2016-01-28 17:20 -0700
SubjectRe: Question about asyncio and blocking operations
Message-ID<mailman.67.1454026859.2338.python-list@python.org>
On Jan 28, 2016 3:07 PM, "Maxime Steisel" <maximesteisel@gmail.com> wrote:
>
> But it is a pretty strange idea to call two fetch*() method concurrently
anyways.

If you want to process rows concurrently and aren't concerned with
processing them in order, it may be attractive to create multiple threads /
coroutines, pass the cursor to each, and let them each call fetchmany
independently. I agree this is a bad idea unless you use a lock to isolate
the calls or are certain that you'll never use a dbapi implementation with
threadsafety < 3.

I pointed it out because the wrapper makes it less obvious that multiple
threads are involved; one could naively assume that the separate calls are
isolated by the event loop.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web