1. ) What is thread ?
A thread is basically a separate sequence of instruction designed to performing a " specific task" in the program.
2. ) What is Multithreading in c# ?
Performing multiple task at same time during the execution of a program,is known as multithreading.
3. ) What is the Namespace used for multithreading in c# ?
using System.Threading;
4. ) What are the advantage of multithreading in c# ?
There are two main advantage to use of multithreading in c#.
6. ) What is the use of Thread class in c#? A thread is basically a separate sequence of instruction designed to performing a " specific task" in the program.
2. ) What is Multithreading in c# ?
Performing multiple task at same time during the execution of a program,is known as multithreading.
3. ) What is the Namespace used for multithreading in c# ?
using System.Threading;
4. ) What are the advantage of multithreading in c# ?
There are two main advantage to use of multithreading in c#.
5. ) What are the classes used in System.Threading Namespace ?
- Thread
- Thread Pool
- Monitor
- Mutex
The Thread class is used to perform tasks such as creating and setting the priority of a thread.
7. ) What are the main properties of thread class?
- Priority
- Thread State
- IsAlive
- Current thread
- Name etc.
8. ) What are the methods used in thread class?
- Join
- Resume
- sleep
- Spin Wait
- Suspended
- Start
- Interrupt
The Thread Pool class is used,to perform task such as processing of asynchronous i/o and waiting on behalf of another thread.
10. ) What are the method used in Thread Pool class ?
- Gettype
- Equals
- SetMaxThreads
- QueueUserWorkItem
The Monitor class is used to access an object by granting a lock for the object to a single thread.
12. ) What are the methods used in monitor class ?
- Enter
- Exit
- TryEnter
- Wait
- GetType
A Mutex is used ,to perform interprocess synchronization and a thread to have exclusive access to shared resources.
14. ) What are the methods used in Mutex class ?
- Equals
- close
- OpenExisting
- SetAccessControl
- Release Mutex
First define a delegate:-
Public delegate void start_thread();
Create a new thread:-
Thread thread_name = new Thread(new start_thread(method_name));
More Details ...
16. ) Can we create timer in threading ?
Yes.
17. ) How can we scheduled a thread in c# ?
We can scheduled the thread with the help of priority property of the Thread class.
18. ) What are the priority value used for scheduling a thread in c# ?
- Highest
- Normal
- AboveNormal
- BelowNormal
- Lowest
19. ) What are the two types of thread in c# ?
- Foreground thread
- Background thread
20 .) What is difference between Foreground and Background thread ?
0 comments:
Post a Comment