Using gtk_timeout_add with very short timeperiods (45 ms)



I'm trying to write a program that reads a hardware port every 45 ms,
it's a CID application with a piece of hardware attached to the
parallell port.

I tried having a gtk_timeout_add that runs a function every 45 ms, but
it doesn't seem to work very well. The Clist I have in the program
doesn't get updated and the same goes for most of the program. You can
still resize the window.

Could this be because of the short time period between the calls? It
might be so that my function takes more than 45 ms, but I don't think
so. I guess I could measure that.

I guess another solution is to have a separate thread blocking on the
hardware. However, I'm still interested in the answer to the question above.

\EF
-- 
Erik Forsberg                 http://www.lysator.liu.se/~forsberg/
PGP fingerprint = 37 1B D7 9E 97 8C EF 39  0E DE 08 E8 99 0C 5E A9




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]