Re: Newbie queue question

2009-06-24 Thread Чеширский Кот
1. say me dbf files count? 2. why dbf ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie queue question

2009-06-21 Thread Jure Erznožnik
On Jun 21, 9:43 am, Чеширский Кот wrote: > 1. say me dbf files count? > 2. why dbf ? It was just a test. It was the most compatible format I could get between Python and the business application I work with without using SQL servers and such. Otherwise it's of no consequence. The final applicatio

Re: Newbie queue question

2009-06-19 Thread Piet van Oostrum
> Jure Erznožnik (JE) wrote: >JE> Digging further, I found this: >JE> >http://www.oreillynet.com/onlamp/blog/2005/10/does_python_have_a_concurrency.html >JE> Looking up on this info, I found this: >JE> >http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock >J

Re: Newbie queue question

2009-06-19 Thread Piet van Oostrum
> Jure Erznožnik (JE) wrote: >JE> Digging further, I found this: >JE> >http://www.oreillynet.com/onlamp/blog/2005/10/does_python_have_a_concurrency.html >JE> Looking up on this info, I found this: >JE> >http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock >J

Re: Newbie queue question

2009-06-19 Thread Tim Harig
On 2009-06-19, =?windows-1252?Q?Jure_Erzno=9Enik?= wrote: > If this is correct, no amount of threading would ever help in Python > since only one core / CPU could *by design* ever be utilized. Except > for the code that accesses *no* functions / memory at all. Don't multithread...multiprocess.

Re: Newbie queue question

2009-06-19 Thread Jure Erznožnik
Digging further, I found this: http://www.oreillynet.com/onlamp/blog/2005/10/does_python_have_a_concurrency.html Looking up on this info, I found this: http://docs.python.org/c-api/init.html#thread-state-and-the-global-interpreter-lock If this is correct, no amount of threading would ever help in

Re: Newbie queue question

2009-06-19 Thread Jure Erznožnik
I've done some further testing on the subject: I also added some calculations in the main loop to see what effect they would have on speed. Of course, I also added the same calculations to the single threaded functions. They were simple summary functions, like average, sum, etc. Almost no interact

Re: Newbie queue question

2009-06-18 Thread Jure Erznožnik
Thanks for the suggestions. I've been looking at the source code of threading support objects and I saw that non-blocking requests in queues use events, while blocking requests just use InterlockedExchange. So plain old put/get is much faster and I've managed to confirm this today with further test

Re: Newbie queue question

2009-06-18 Thread Piet van Oostrum
> Jure Erznožnik (JE) wrote: >JE> Hi, >JE> I'm pretty new to Python (2.6) and I've run into a problem I just >JE> can't seem to solve. >JE> I'm using dbfpy to access DBF tables as part of a little test project. >JE> I've programmed two separate functions, one that reads the DBF in main >JE> t

Newbie queue question

2009-06-17 Thread Jure Erznožnik
Hi, I'm pretty new to Python (2.6) and I've run into a problem I just can't seem to solve. I'm using dbfpy to access DBF tables as part of a little test project. I've programmed two separate functions, one that reads the DBF in main thread and the other which reads the DBF asynchronously in a separ

Re: Queue() question. This post is pretty long.

2009-04-16 Thread grocery_stocker
On Apr 16, 11:46 am, Piet van Oostrum wrote: > > grocery_stocker (g) wrote: > >g> [cdal...@localhost ~]$ python > >g> Python 2.4.3 (#1, Oct 1 2006, 18:00:19) > >g> [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 > >g> Type "help", "copyright", "credits" or "license" for more information. >

Re: Queue() question. This post is pretty long.

2009-04-16 Thread Piet van Oostrum
> grocery_stocker (g) wrote: >g> [cdal...@localhost ~]$ python >g> Python 2.4.3 (#1, Oct 1 2006, 18:00:19) >g> [GCC 4.1.1 20060928 (Red Hat 4.1.1-28)] on linux2 >g> Type "help", "copyright", "credits" or "license" for more information. > import Queue > queue = Queue.Queue() > >>

Queue() question. This post is pretty long.

2009-04-16 Thread grocery_stocker
I don't get how item = self.__queue.get() gets advanced to if item is None: in the following code. >>> import time >>> from threading import Thread >>> import Queue >>> >>> WORKER = 2 >>> >>> class Worker(Thread): ... def __init__(self, queue): ... Thread.__init__(self) ...

Re: Queue question

2005-10-17 Thread Tim Peters
[Alex Martelli] > ... > not_empty and not_full are not methods but rather instances of the > threading.Condition class, which gets waited on and notified > appropriately. I'm not entirely sure exactly WHAT one is supposed to do > with the Condition instances in question (I'm sure there is some des

Re: Queue question

2005-10-17 Thread Alex Martelli
Steve M <[EMAIL PROTECTED]> wrote: > According to my "Python in a Nutshell": > > q.get(block=True) > > is the signature, so, as you use it above, the call will hang until > something is on the queue. If block is false and the queue is empty, > q.get() will raise the exception Empty. > > q.get_n

Re: Queue question

2005-10-16 Thread spinner
Ahh the penny has dropped at last. I am using the WingIDE and .not_empty is one of the properties it exposes with it's intellisense. As such its use is not documented. No problem. Using the exception would more accurate - I can see that. In my simple case the queue is a one to one link, into an

Re: Queue question

2005-10-15 Thread Steve M
According to my "Python in a Nutshell": q.get(block=True) is the signature, so, as you use it above, the call will hang until something is on the queue. If block is false and the queue is empty, q.get() will raise the exception Empty. q.get_nowait is apparently synonymous with q.get(block=False)

Queue question

2005-10-15 Thread spinner
- A two parter newbie question I am afraid. Am I right in thinking that using something like ... item = a_queue.get() print item will not print 'item' unless or until there is an item in the queue to retrieve. Effectively stalling the thread at the .