Read from database, write to another database, simultaneously

Bjoern Schliessmann usenet-mail-0306.20.chr0n0ss at spamgourmet.com
Thu Jan 11 12:24:33 EST 2007


Laurent Pointal wrote:

> Not so sure, there is low CPU in the Python script,

Yes.

> but there may be CPU+disk activity on the database sides [with
> cache management and other optimizations on disk access].

That's it. So data queues up on the database side and you won't get
much value from faked concurrency with CPU cycles.

> So, with a reader thread and a writer thread, he can have a select
> on a database performed in parallel with an insert on the other
> database.

Explain. Remember, threads aren't really working concurrently. Even
on a multiprocessor machine you have constraints for IO traffic.
(And the GIL exists too)

> But, if its only a do-once job, maybe the optimization is net
> really necessary.

I still don't understand how threads would help optimizing a task
that largely depends on IO and will probably be executed on one
CPU.

Regards,


Björn

-- 
BOFH excuse #14:

sounds like a Windows problem, try calling Microsoft support




More information about the Python-list mailing list