While there is a code executed by the thread it cannot throw its stack. Once
the thread procedure exits you the thread stack is empty and all local data
is gone anyway. When the thread is finalized all the resources it holds
(including the stack) are released.
--
Stoitcho Goutsev (100)
"ano" <an*@discussions.microsoft.com> wrote in message
news:9C**********************************@microsof t.com...
I mean a stack memory. Will it use the same stack or create create a new
one
when the button is clicked? Will the threads throw their own stack when
their
status is Stop?
Thanks,
"Stoitcho Goutsev (100)" wrote:
ano,
What do you mean by releasing a memory.
The thread doesn't own any memory except that it has its own stack. The
memory is own by a process and threads are something like virtual CPUs
executing the code.
--
Stoitcho Goutsev (100)
"ano" <an*@discussions.microsoft.com> wrote in message
news:83**********************************@microsof t.com... >I create a method that copy files from one folder to another (see the
>ex.
> code).
> A new thread will create every time when user click the button.
> The button is enable only when the copy process was finished(
> ThreadState
> =
> Stop )
>
> My question is when ThreadState = Stop, the system will release the
> Memory
> or not?
>
> Is my code generated multiply threads?
>
> Thanks,
>
>
> Code:
>
> private Thread copyFiles;
>
> private void btnImport_Click(object sender, System.EventArgs e)
> {
> copyFiles = new Thread( new ThreadStart(CopyFilesToProcessFolder) );
> copyFiles.Start();
> }