Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re^5: Perl tk gui hangs when large data thrown to it

by RichardK (Parson)
on Oct 15, 2013 at 13:11 UTC ( #1058293=note: print w/replies, xml ) Need Help??

in reply to Re^4: Perl tk gui hangs when large data thrown to it
in thread Perl tk gui hangs when large data thrown to it

I think you're just expecting too much. You cannot see an event that only lasts 1 millisecond so there's no point updating you display that quickly. If you data really is changing that quickly just cache it until the next screen update.

I've changed the repeat to 20ms, removed the prints from changeitem and increased then rand row to 100, and your code works. But even 50 updates per second are too many, I'd try 10 or less, as you don't really need video rates.

  • Comment on Re^5: Perl tk gui hangs when large data thrown to it

Replies are listed 'Best First'.
Re^6: Perl tk gui hangs when large data thrown to it
by Anonymous Monk on Oct 15, 2013 at 16:54 UTC

    Ok, I understand.
    But I even tried the same thing with thread, where the inter-process communication is happening in one thread and the gui is in another thread. I hoped threading would be able to handle the scenario but it could not. As I have explained earlier in this post, the client is sending data with usleep(some number) interval of time, the server reads the data and writes that into a shared variable. The gui thread reads from that shared variable and invokes the relevant gui updateDisplay() routine to update the gui.
    But this also not bringing things up if the usleep is very small amount of time and I am trying to change some 1k rows every millisecond. But how can not threading the handle this problem ? Why this gui is not responding ?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1058293]
[corenth]: Good morning (in my neck of the woods)
[Cosmic37]: hello perly kings and queens
[jedikaiti]: 'ello Monks
[Cosmic37]: and monkeys too...
[Cosmic37]: is anyone doing machine learning with Perl?
[Cosmic37]: I was using gneural code in C and it was interesting but did not have back propagation for neural networks
[corenth]: Cosmic, poking at it, but not really.
[Cosmic37]: I read that its possible to use the FANN library with Perl so I might try that now...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2018-02-20 18:11 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (274 votes). Check out past polls.