String [] urlcp = getpage (curl );
Thread [] mythread = new thread [urlcp. Length];
For (INT I = 0; I <urlcp. length; I ++)
{
// Getcontent (curl );
Getcontent (urlcp [I]);
Object [] urcp1 = (object []) urlcp;
Mythread [I] = new thread (New parameterizedthreadstart (getcontent1 ));
Mythread [I]. Start (urcp1); // pass the Parameter
}
Parameterizedthreadstart with object parameters: Public void start ()
{
For (INT Index = 0; index <10; index ++)
{
# Region -- prepare parameters --
List <int> List = new list <int> ();
For (INT Param = index; Param <index + 10; Param ++)
{
List. Add (PARAM );
}
# Endregion
Thread thread = new thread (New parameterizedthreadstart (initthreadfunc ));
Thread. Start (list );
}
Loghelper. writeline ("over ");
}
/// <Summary>
/// Executed Function
/// </Summary>
/// <Param name = "list"> </param>
Private void initthreadfunc (Object List)
{
If (list is list <int>)
{
List <int> LL = List as list <int>;
Int result = 0;
Foreach (int n in LL)
{
Result + = N;
}
Loghelper. writeline (result );
}
}
Second:
Initthreadfunc without Parameters
Public void start ()
{
For (INT Index = 0; index <10; index ++)
{
Thread thread = new thread (New threadstart (initthreadfunc ));
Thread. Start ();
}
Loghelper. writeline ("over ");
}
Private void initthreadfunc (){}