Re: Python threading



En Thu, 08 Mar 2007 14:25:02 -0300, <test.07@xxxxxxxxx> escribió:

I am wondering what happens to a thread in python in relation to
win32com extensions.

If I create a new thread, that uses the Dispatch method from win32com,
what happens to the memory allocated in that thread when the thread is
done. Will the Dispatch release the memory it created, or will the
memory remain?

The problem rises from the fact that Dispatch does not seem to release
memory correctly every time. If I include the commands in a thread by
themselves, will the thread clean up ALL memory it used after it is
done?

All threads share the same memory space, there is not a "per-thread" memory allocator, if that's what you are thinking.
Perhaps you hold a reference to some objects in the Thread object? Or you still keep the Thread object itself?

I did try the pythoncom.CoUnitialize() to release memory, but it
doesn't seem to work (it does work about 30-45 seconds after the
command is run).

I don't understand what you say here.
What means "it doesn't seem to work" and "it does work 30 seconds after"?

Any input is greatly appreciated (on the thread issue or how to use
the pythoncom.CoUnitiliaze() to make it release memory right away).

What memory do you want to release "right away"?

--
Gabriel Genellina

.



Relevant Pages

  • Re: Updated Neon+
    ... from "Dispatch Table Trimming" that's all they are talking about. ... So Neon+ would use about 100K for the same due to trimming. ... Not very large in this day of 1-2 GIG memory machines. ... The Java core is rather large for something called a "core" ...
    (comp.lang.forth)
  • Python threading
    ... win32com extensions. ... If I create a new thread, that uses the Dispatch method from win32com, ... Will the Dispatch release the memory it created, ... If I include the commands in a thread by ...
    (comp.lang.python)
  • Re: Problem with Threads memory (possible bug)
    ... Problem with Thread's memory " ... |I have a window, and dispatch all keyboard events to Ruby's block. ...
    (comp.lang.ruby)
  • Re: malloc ? ?
    ... > The OS memory allocator will map a piece of free memory into a virtual ... mean when a processes is created some core memory is requested and this ...
    (comp.os.research)
  • Re: Wait free queue
    ... I have a wait-free, non-atomic local memory allocate/ ... dealloc, lock-free remote memory dealloc among producers, wait-free ... memory allocator blows the msvcrt away--why bother with it, ...
    (comp.programming.threads)