Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
My concerns stem from the fact that with each thread, the memory usage increases by ~2MB, so for 7 datasource threads plus the main thread, I use up around 16MB of memory. I don't consider this to be wrong(is it?), but it does seem a bit inefficient. I originally hoped that each datasource thread would be called, then finish, rather than sitting on the memory perpetually. However, I could not get multiple "timers" to run independently of one another without either forking or threading them off from the main. Of course there may be a way, but I don't know it. :)
So, the questions are: Is there a way to run independent timers without one persistent thread for each? Even if there was, would the memory they use just stay allocated to the main process and not get released back to the OS anyway? Is there a better way, generally speaking, of handling a threading situation like this?
Thanks very much in advance. Hope it wasn't all too vague.
mike
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multiple threads with different "timers"
by BrowserUk (Patriarch) on Nov 21, 2002 at 17:46 UTC | |
|
Re: multiple threads with different "timers"
by traveler (Parson) on Nov 21, 2002 at 17:54 UTC | |
|
Re: multiple threads with different "timers"
by pg (Canon) on Nov 21, 2002 at 19:22 UTC | |
|
Re: multiple threads with different "timers"
by petral (Curate) on Nov 22, 2002 at 01:37 UTC | |
|
Re: multiple threads with different "timers"
by adrianh (Chancellor) on Nov 22, 2002 at 00:08 UTC | |
|
Re: multiple threads with different "timers"
by Anonymous Monk on Nov 22, 2002 at 03:24 UTC |