Dear Dragan,
What you're describing you want to do is beyond the scope of pytables
itself. Pytables already does all that could be expected of it, namely
releasing the GIL so that other Python threads can execute while a
long-running C-API call is executed. The question of number of CPUs is
only partially relevant -- a single Python process can only execute the
interpreter in one thread at a time (hence the GIL), resulting in
multi-processor programming that looks a lot like single processor
programming. The biggest issue is that sometimes (often) calls to
libhdf5 block while waiting for the hard disk to return data, and you
just want another thread to get a slice of the CPU (for a GUI, for
example) instead of waiting all that time and cycles waiting for the I/O
operation to finish.
What you claim you want, raising one thread's priority over another, is
in the domain of operating system-dependent scheduler tricks. On POSIX
systems, you can use the sched_setscheduler() system call. I have a
Pyrex wrapper for these calls available at
http://www.its.caltech.edu/~astraw/coding.html#id6 . Similar tricks are
available for win32, but I don't really dabble with that stuff too much.
Cheers!
Andrew
Francesc Altet wrote:
A Dijous 02 Març 2006 16:47, vàreu escriure:
Hello again!
Fisrt of all I am working on single CPU machine. I do
have a seperate thread for listening to external
commandas. The idea is that all long jobs should be
started as seperate threads (e.g. writting data to a
table) but should not block light jobs for being
executed. In my example a light job is executed after
the heavy one. I just want to improve the
interactivity so I don't wait for something that could
be executed immediately without blocking.
And sending both long jobs and lighter ones to different threads does
not help? I'm not an expert on threading, but my guess is that if you
send a job A to thread 1 that takes, say, 3 minutes to get done and 1
minute after that, you send a job B to thread 2 that takes 1 seconds,
I think that the job B should get done shortly after 1 minute an 1
second.
Again, I'm not an expert on threading, so perhaps you can get some
feedback about your problem in the general python list.
Cheers,
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Pytables-users mailing list
Pytables-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pytables-users