Cdelegate cDelegate = new Cdelegate ( );
ThreadStart trSt = new ThreadStart ( cDelegate.csvTOsql );
Thread trd = new Thread ( trSt, 5000 );
trd.Start ( );
I ran this code and it seems to be working fine, however, two things remain unclear.
(1) Do I have to take any special steps to terminate the thread after work of the delegate is done. If so, how can I do it
(2) I ran it a few times in debug. The delegate csvTOsql transfers some scv files (about 200 of them to SQLEXPRESS server. On the second run and that run only I got a runtime error message that I neglected to copy since I expected it to be repeated. It never came up again but I expect it to show up in the future. I will try to reproduce it from memory:
Thread (perhaps, process ) ID = 58 was locked in competition for resources. Process 58 was chosen as victim.
My question is: shall I increase the buffer size to avoid this to happen or what
Many thanks.
Merry Christmas.

new Thread questions
Tuk
MarijnStevens
I just noticed another unpleasant thing. After the delegate executes to the end that thread just hangs up and never terminates. There are a couple of statements after the last statement. They remain unexecuted.
Thanks.
Wellnow
Try just calling the Thread(ThreadStart) constructor instead (i.e. delete ", 5000" where you create the new thread) and see what happens.
When the delegate completes the thread terminates...
dba123
256k sounds a little strange. Keep in mind that regardless of the stack size you request only a certain amount is commited at the start, as stack usage grows more of the stack is committed a page at a time. The default process thread stack size is 1M. And although all 1M is not commited 1M of viritual memory is now in use.