User FAQs
If you have a question, please send it to us.
1) What is Multi-Threading ?
This allows different tasks to be carried out in parallel.
The advantage of a divide and conquer strategy is that it will improve performance.
2) What is the difference between a Background Thread and a Foreground Thread ?
A foreground thread runs indefinitely.
A background thread terminates when the foreground thread is stopped.
3) What does the 'async' keyword do ?
Introduced in C# 5.0 (.NET 4.5).
4) What is displayed when this code runs ?
public main()
{
Method1()
MessageBox.Show("Two");
}
public async void Method1()
{
thread.wait(10);
MessageBox.Show("One");
}
The Method1 is executed on a different thread and this message box will only be displayed after the 10 seconds.
"Two"
"One"
5) What does the [ThreadStatic] attribute do ?
System.ThreadStaticAttribute
This is used to indicate a variable is thread safe.
A static variable is not shared between threads.
Each executing thread will have a separate instance of the field and will independently set and get values for that variables.
If the variable is accessed on a different thread, it will contain a different value.
© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext