in reply to threads causing memory leak
You say "the code is called every 30 seconds" - do you mean you create a new thread every 30 seconds? Do you ever ->join that thread? Otherwise, I think you should use async. Personally, I would put the fetched results in a Thread::Queue and retrieve it from there in the main thread, so that all updating of new data happens within the main thread and only the fetching happens asynchronously, using ->dequeue_nb().
As Win32::GUI is event-driven, it might even make sense to have the worker thread send a window message to the main program to tell it to fetch the result.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: threads causing memory leak
by holli (Abbot) on Sep 11, 2010 at 13:43 UTC | |
by BrowserUk (Patriarch) on Sep 11, 2010 at 14:49 UTC | |
by Proclus (Beadle) on Sep 12, 2010 at 11:29 UTC | |
by BrowserUk (Patriarch) on Sep 12, 2010 at 14:05 UTC | |
by tsee (Curate) on Sep 13, 2010 at 14:29 UTC | |
by Anonymous Monk on Sep 13, 2010 at 15:05 UTC |