1. Name some of the Operation on Data Structures
2. Define a) FileInfo b) DirectoryInfo
Ø FileInfo and DirectoryInfo are the classes that support file management operations
Ø Such as
· copying ,
· deleting a file / Directory.
Ø FileSystemInfo is an abstract class from which FileInfo and DirectoryInfo classes have been derived.
Ø The methods provided in the classes FileInfo and DirectoryInfo are instance methods.
3. Define thread.
A thread is a path of execution within a program that can be executed separately. In .NET framework threads run in application domains. A thread is also known as lightweight process.
4. What are the characteristics or advantages of threads?
Ø Threads have execution states and may synchronize with another.
Ø Threads share the same address space.
Ø Context switching between threads is normally inexpensive.
Ø Communication between threads is also inexpensive.
5. What is Multitaking ?
Modern OS hold more than one activity(program) in memory and the processor can switch among all to execute them. Simultaneous execution of many programs on the computer is known as multitasking.
6. What is multithreading?
Ø C# allows the concept of Multithreading , which enables execution of two or more parts of a program concurrently. Each part is known as a thread.
Ø The execution of C# program starts with a single thread known as main thread and that is automatically run by the CLR and the OS. From the main thread, we can create other threads for performing desired tasks.
Ø The process of execution of multiple threads is known as multithreading.
7. What are the characteristics and advantages of multithreading?
Ø Multithreading allows us to develop efficient programs that could optimize the use of computer resources such as CPU, memory and I/O devices.
Ø Threading namespace contains classes and interfaces that are required for developing and running multithreaded programs.
8. Differentiate a process and a thread.
Ø A process is a program in execution.
Ø The creations of processes are controlled by the operating system.
Ø A thread is a unit of execution which is a part of a program. Simultaneously many threads can be created and they can be started. It is called multi threading.
Ø A thread is under the control of the programmer.
9. What is synchronization? How it is enforced in C#?
Ø We can easily create multiple thread of execution. It is often necessary for multiple threads to share a resource without control.
Ø The behaviour of multi threaded programs sharing a resource yields non-deterministic results.
Ø To provide control over multiple threads under execution, C# allocates methods to co-ordinate activities between threads.
Ø A process which is used to coordinate the activities of two or more threads is called synchronization.
Ø The need for Syncronization arises when two or more threads try to access shared resource that can be used only one thread at a time.
Ø Synchronization enables performance benefits of multithreading as well as maintaining the integrity of the object state and data.
Ø C# uses lock keyword to provide data synchronization.
10. What is critical section?
Ø A method containing code involving shared access/update of data by many threads, is known as a critical section.
Ø A critical section can be defined in C# using :
· Monitor class
· Mutex class
· Lock statement