Summary: Oefenexamens E.d.
- This + 400k other summaries
- A unique study and practice tool
- Never study anything twice again
- Get the grades you hope for
- 100% sure, 100% understanding
Read the summary and the most important questions on Oefenexamens e.d.
-
1 Manage Program Flow
-
1.1 Implement multithreading and asynchronous processing
-
What is an event in C#?
An event is nothing but anencapsulated delegate. -
What specifies an event in c#?
An event has a publisher, subscriber, notification and a handler. -
What is a process?
A process isolates an application from other applications by giving it its own virtual memory and by ensuring that different processes can't influence eachother. Each process runs in its own thread. -
1.1.1 Understanding Threads
This is a preview. There are 3 more flashcards available for chapter 1.1.1
Show more cards here -
What is a thread?
A thread is something like avirtualized CPU . If an application crashes or hits an infinite loop, only theapplication's process is affected. Denk hierbij aan het poel met "threadjes". Er wordt voor een proces een thread gepakt om het uit te voeren. Zodra de taak klaar is komt de thread weer terug in de poel. -
What is context switching?
Each thread is allowed by windows toexecute for a certain time period. After this period ends, the thread ispaused and Windowsswitches to another thread. -
What does the Thread class do, and in which namespace is it found?
In the System.Threading namespace . It enables you to create new threads, manage their priority, and get their status. -
What does the Thread.Join method do?
Wait until the other thread finishes. -
What does the Thread.Sleep(0) method do?
It is used to signal to Windows that this thread is finished. Instead of waiting for the whole time-slice of the thread to finish, it will immediately switch to another thread.
Alternative answer:
It will force the current thread to give up the rest of the CPU time slice. -
What is the difference between background and foreground threads in C#?
By default, threads are foreground threads, meaning they keep the application alive for as long as any one of them is running. C# also supports background threads, which don't keep the application alive on their own – terminating immediately once all foreground threads have ended -
Which method do you use to stop a thread?
The Thread.Abort method.
- Higher grades + faster learning
- Never study anything twice
- 100% sure, 100% understanding