Re: Problem with time.time() standing still

2012-05-10 Thread Bob Cowdery
Hi Roel "Our problem turned out to be caused by a loss of precision in an application of ours, caused by Direct3D. The solution for us was to include the flag D3DCREATE_FPU_PRESERVE in CreateDevice(). The documentation seems to imply that the lower precision only has effect in the Direct3D code, b

Re: Problem with time.time() standing still

2012-05-10 Thread Roel Schroeven
Hi Bob, This reminds of a problem we had at work some years ago. I've followed the thread from the beginning, but I hadn't a clue about what could possibly cause the problem until you said: Bob Cowdery schreef: Hopefully somebody can add the last piece of this puzzle. My code didn't work becaus

Re: Problem with time.time() standing still

2012-05-08 Thread Bob Cowdery
Hopefully somebody can add the last piece of this puzzle. My code didn't work because I did make a silly mistake. The number of seconds since EPOC is a large number but it also needs a high precision. Attempting to put this value into a 32 bit float corrupts the least significant part because 2

Re: Problem with time.time() standing still

2012-05-08 Thread Bob Cowdery
Can anyone make sense of this. I've looked over the Python timemodule.c again and it uses one of gettimeofday(), ftime() or time(). The gettimeofday() is not available on Windows so its going to use ftime() or time(). As time() only has a resolution of 1 second and returns a long and I know Py

Re: Problem with time.time() standing still

2012-05-06 Thread Bob Cowdery
On 06/05/2012 09:49, Cameron Simpson wrote: > On 06May2012 09:18, Bob Cowdery wrote: > | On 05/05/2012 23:05, Cameron Simpson wrote: > | > On 05May2012 20:33, Bob Cowdery wrote: > | > | [...] calls to time.time() always return the same > | > | time which is usually several seconds in the past or

Re: Problem with time.time() standing still

2012-05-06 Thread Bob Cowdery
On 06/05/2012 09:24, Chris Angelico wrote: > On Sun, May 6, 2012 at 6:18 PM, Bob Cowdery wrote: >> On 05/05/2012 23:05, Cameron Simpson wrote: >>> Thought #1: you are calling time.time() and haven't unfortunately >>> renamed it? (I doubt this scenario, though the lack of fractional part >>> is int

Re: Problem with time.time() standing still

2012-05-06 Thread Cameron Simpson
On 06May2012 09:18, Bob Cowdery wrote: | On 05/05/2012 23:05, Cameron Simpson wrote: | > On 05May2012 20:33, Bob Cowdery wrote: | > | [...] calls to time.time() always return the same | > | time which is usually several seconds in the past or future and always | > | has no fractional part. | > |

Re: Problem with time.time() standing still

2012-05-06 Thread Chris Angelico
On Sun, May 6, 2012 at 6:18 PM, Bob Cowdery wrote: > On 05/05/2012 23:05, Cameron Simpson wrote: >> Thought #1: you are calling time.time() and haven't unfortunately >> renamed it? (I doubt this scenario, though the lack of fractional part >> is interesting.) > Not sure what you mean by renamed it

Re: Problem with time.time() standing still

2012-05-06 Thread Bob Cowdery
On 06/05/2012 00:11, Chris Angelico wrote: > On Sun, May 6, 2012 at 6:51 AM, Bob Cowdery wrote: >> The time.clock() function does increment correctly. CPU is around 30% > 30% of how many cores? If that's a quad-core processor, that could > indicate one core completely pegged plus a little usage el

Re: Problem with time.time() standing still

2012-05-06 Thread Bob Cowdery
On 05/05/2012 23:05, Cameron Simpson wrote: > On 05May2012 20:33, Bob Cowdery wrote: > | I've written a straight forward extension that wraps a vendors SDK for a > | video capture card. All works well except that in the Python thread on > | which I call the extension, after certain calls that I be

Re: Problem with time.time() standing still

2012-05-05 Thread Chris Angelico
On Sun, May 6, 2012 at 6:51 AM, Bob Cowdery wrote: > The time.clock() function does increment correctly. CPU is around 30% 30% of how many cores? If that's a quad-core processor, that could indicate one core completely pegged plus a little usage elsewhere. ChrisA -- http://mail.python.org/mailm

Re: Problem with time.time() standing still

2012-05-05 Thread Cameron Simpson
On 05May2012 20:33, Bob Cowdery wrote: | I've written a straight forward extension that wraps a vendors SDK for a | video capture card. All works well except that in the Python thread on | which I call the extension, after certain calls that I believe are using | DirectShow, time stands still. Th

Re: Problem with time.time() standing still

2012-05-05 Thread Bob Cowdery
Thanks Daniel, that's interesting. Unfortunately there is no sensible code I can post because this only happens when I make a specific call into the vendors SDK. I can exercise my own code in the extension without a problem. The python test calling code is doing practically nothing. I make 3 calls

Re: Problem with time.time() standing still

2012-05-05 Thread Danyel Lawson
Add a time.sleep(0) call to all your loops. Multithreading in Python is a cooperative cross platform threading simulation if you have tight loops Python won't task switch until you make a system call. Potentially preventing internal library variables from being updated. Your five minute interval m

Problem with time.time() standing still

2012-05-05 Thread Bob Cowdery
Hi all, I've been a long time user of Python and written many extensions but this problem has me stumped. I've written a straight forward extension that wraps a vendors SDK for a video capture card. All works well except that in the Python thread on which I call the extension, after certain calls