Found 173 Articles for Windows

Resuming Process Monitoring for a Process Instance

Arnab Chakraborty
Updated on 17-Oct-2019 10:51:37

736 Views

If several processes are suspended on condition x, and an x.signal() operation is executed by some process, then we can determine that which of the suspended processes should be resumed next by one simple solution is to use a first-come, first-served (FCFS) ordering, so that the process that has been waiting the longest is resumed first. In many circumstances, however, such a simple scheduling scheme is not adequate. For this reason, the conditional-wait construct can be used. This construct has the formx.wait(c);Here c is an integer expression that is evaluated when the wait() operation is executed. The value of c, ... Read More

Peterson’s Problem

Arnab Chakraborty
Updated on 17-Oct-2019 10:49:16

19K+ Views

Peterson’s solution provides a good algorithmic description of solving the critical-section problem and illustrates some of the complexities involved in designing software that addresses the requirements of mutual exclusion, progress, and bounded waiting.do {    flag[i] = true;    turn = j;    while (flag[j] && turn == j);    /* critical section */    flag[i] = false;    /* remainder section */ } while (true);The structure of process Pi in Peterson’s solution. This solution is restricted to two processes that alternate execution between their critical sections and remainder sections. The processes are numbered P0 and P1. We use Pj ... Read More

Hardware Synchronization

Arnab Chakraborty
Updated on 17-Oct-2019 09:18:41

17K+ Views

In Synchronization hardware, we explore several more solutions to the critical-section problem using techniques ranging from hardware to software based APIs available to application programmers. These solutions are based on the premise of locking; however, the design of such locks can be quite sophisticated.These Hardware features can make any programming task easier and improve system efficiency. Here, we present some simple hardware instructions that are available on many systems and show how they can be used effectively in solving the critical-section problem. If we could prevent interrupts from occurring while a shared variable was being modified. The critical-section problem could ... Read More

Data structures of a Windows thread

Arnab Chakraborty
Updated on 17-Oct-2019 09:10:35

706 Views

Windows implements the Windows API, which is the primary API for the family of Microsoft operating systems (Windows 98, NT, 2000, and XP, as well as Windows 7). Basically A Windows application runs as a separate process, and each process may contain one or more threads. Additionally, Windows uses the one-to-one mapping, where each user-level thread maps to an associated kernel thread. The general components of a thread include −A thread ID uniquely identifying the threadA set of register representing the status of the processorA stack of user, employed when the thread is running in user mode, and a kernel ... Read More

Lightweight process (LWP)

Arnab Chakraborty
Updated on 17-Oct-2019 09:07:48

3K+ Views

Many systems implement either the many-to-many or the two-level model place an intermediate data structure between the user and kernel threads. This data structure—typically known as a lightweight process, or LWP—is shown in below Figure. The LWP appears to be a virtual processor on which the application can schedule a user thread to run, to the user-thread library. Each Light Weight Process is attached to a kernel thread, and it is kernel threads that the operating system schedules to run on physical processors. The LWP blocks as well, if a kernel thread blocks (such as while waiting for an I/O ... Read More

Scheduler activations

Arnab Chakraborty
Updated on 17-Oct-2019 09:05:22

2K+ Views

One technique for communication between the user-thread library and the kernel is known as scheduler activation. It works as likes: The kernel provides an application with a set of virtual processors (LWPs), and the application can schedule user threads onto an available virtual processor. Moreover, the kernel must inform an application about certain events. This procedure is known as an upcall. Upcalls are handled by the thread library with an upcall handler, and upcall handlers must run on a virtual processor. One event that triggers an upcall occurs when an application thread is about to block. In this scenario, the ... Read More

Thread-local storage (TLS)

Arnab Chakraborty
Updated on 17-Oct-2019 09:03:18

931 Views

Threads share the data of the process to which it belongs to. This data sharing provides one of the benefits of multithreaded programming. However, in some circumstances, each thread might need its own copy of certain data. Such data is called thread-local storage (or TLS).For example, in a transaction-processing system, we might service each transaction in a separate thread. Each transaction might be assigned a unique identifier. To associate each thread with its unique identifier, we could use thread-local storage.It is easy to puzzle TLS with local variables. During a single function invocation only local variables are visible, whereas TLS ... Read More

What is Thread cancellation?

Arnab Chakraborty
Updated on 31-Jan-2020 11:07:24

6K+ Views

Terminating a thread before it has completed is called Thread cancellation. For an example, if multiple threads are concurrently searching through a database and one thread returns the result, the remaining threads might be canceled. Another situation might be occurred when a user presses a button on a web browser that stops a web page from loading any further. Often, using several threads a web page loads — each image is loaded in a separate thread. When the stop button is pressed by a user on the browser, all threads loading the page are canceled. A thread which is to ... Read More

What is default signal handler?

Arnab Chakraborty
Updated on 17-Oct-2019 09:00:01

1K+ Views

Signals are software interrupts which sent to a program to indicate that an important event has occurred. A Signal may be handled by following one of two possible handlers:A default signal handlerA user-defined signal handlerA Default signal handler is associated with every signal that the kernel runs when handling that signal. The action that a script or program performs when it receives a signal is called the default actions. A default signal handler handles these types of different default actions.Some of the possible default actions are −Terminate the process.Ignore the signal.Dump core. It creates a file called core containing the ... Read More

What is user-defined signal handler?

Arnab Chakraborty
Updated on 31-Jan-2020 11:05:12

1K+ Views

Signals are software interrupts which sent to a program to indicate that an important event has occurred. A Signal may be handled by following one of two possible handlers:A default signal handlerA user-defined signal handlerUser-defined signal handler can override this default action that is called to handle the signal. Signals are handled in different ways. Some signals (such as changing the size of a window) are simply ignored; others (such as an illegal memory access) are handled by terminating the program.A signal handler function may have any name, but must have return type void and have one int parameter.Example − ... Read More

Advertisements