Found 173 Articles for Windows

What is the difference between context switching and interrupt handling?

Arnab Chakraborty
Updated on 16-Oct-2019 08:22:20

2K+ Views

Context switching involves storing the context or state of a method or thread in order that it will be reloaded once needed and execution will be resumed from constant purpose as earlier. This can be a feature of a multitasking software system and permits one computer hardware to be shared by multiple processes.When Associate in Nursing interrupt happens, the hardware mechanically switches a region of the context. The handler could save further context, counting on details of the actual hardware and software package styles. Typically, solely a minimal part of the context is modified so as to reduce the quantity ... Read More

Microsoft Interface Definition Language

Arnab Chakraborty
Updated on 16-Oct-2019 08:20:33

353 Views

DefinitionThe Microsoft Interface Definition Language (MIDL) defines interfaces between client and server programs. The MIDL compiler with the Platform Software Development Kit (SDK) to enable developers to create the interface definition language (IDL) files and application configuration files (ACF) required for Remote Procedure Call (RPC) interfaces and COM/DCOM interfaces are included with Microsoft. MIDL also supports the generation of type libraries for OLE Automation.ApplicationMIDL can be used in all client/server applications based on Windows operating systems. To create client and server programs for heterogeneous network environments that include such operating systems as Unix and Apple, MIDL can also be used. ... Read More

Big Endian and Little Endian

Arnab Chakraborty
Updated on 11-Oct-2019 13:15:43

17K+ Views

All computers do not store the bytes that comprise a multi-byte value in the same order. Consider a 16-bit internet that is made up of 2 bytes. Two ways to store this value −Little Endian − In this scheme, low-order byte is stored on the starting address (A) and high-order byte is stored on the next address (A + 1).Big Endian − In this scheme, high-order byte is stored on the starting address (A) and low-order byte is stored on the next address (A + 1).To allow machines with different byte order conventions communicate with each other, the Internet protocols ... Read More

How does a process look like in memory?

Arnab Chakraborty
Updated on 11-Oct-2019 13:04:47

5K+ Views

A program loaded into memory and executing is called a process. In simple, a process is a program in execution.When a program is created then it is just some pieces of Bytes which is stored in Hard Disk as a passive entity. Then the program starts loading in memory and become an active entity, when a program is double-clicked in windows or entering the name of the executable file on the command line. (i.e. a.out or prog.exe)Let’s look at each memory segment and how does a process look like within memory −Figure: Process in MemoryTEXTA process is more than the ... Read More

Deadlock with mutex locks

Arnab Chakraborty
Updated on 11-Oct-2019 13:01:45

7K+ Views

Deadlock can be occurred in a multithreaded Pthread program using mutex locks. Let’s see how it can be occurred. An unlocked mutex is initialized by the pthread_mutex_init() function.Using pthread_mutex_lock() and pthread_mutex_unlock() Mutex locks are acquired and released. If a thread try to acquire a locked mutex, the call to pthread_mutex_lock() blocks the thread until the owner of the mutex lock invokes pthread_mutex_unlock().Let’s take an example, two Mutex locks are created in the following Code −/* Create and initialize the mutex locks */ pthread mutex t mutex1; pthread mutex t mutex2; pthread mutex init(&mutex1, NULL); pthread mutex init(&mutex2, NULL);Next, two threads ... Read More

Transactional memory

Arnab Chakraborty
Updated on 11-Oct-2019 12:58:19

838 Views

Transactional memory originated in database theory, provides an alternative strategy for process synchronization.A memory transaction is atomic is a sequence of memory read–write operations. The memory transaction is committed, if all operations in a transaction are completed. Otherwise, the operations must be aborted and rolled back. The ease of transactional memory can be obtained through features added to a programming language. Consider an example. Suppose we have a function update() that modifies shared data. Traditionally, this function would be written using mutex locks (or semaphores) such as the following −void update (){    acquire(); /* modify shared data */   ... Read More

Process Synchronization in Solaris

Arnab Chakraborty
Updated on 11-Oct-2019 12:56:30

2K+ Views

Solaris implements variety of locks to support multitasking, multithreading and multiprocessing. It uses adaptive mutexes, conditional variables, semaphores, read-write locks, turnstiles to control access to critical sections.An adaptive mutex uses for protecting every critical data item which are only accessed by short code segments.On A multiprocessor system it starts as a standard semaphore spin-lock. If the lock is held by a thread which is running on another CPU then the thread spins. If the lock is held by a thread which is currently in run state, the thread blocks, going to sleep until it is awakened by the signal of ... Read More

Process Synchronization in Windows

Arnab Chakraborty
Updated on 11-Oct-2019 12:53:41

2K+ Views

Windows operating system is a multithreaded kernel that provide support for real time application and multiprocessors. On uniprocessor system, Windows provides interrupt masks to protect access to global resources. It protects access to global resource using spinlock. The kernel uses spinlocks only to protect short code segment like Solaris. The kernel ensures that while holding a spinlock, a thread will never be preempted.Windows provide dispatcher object for thread synchronization according to several different mechanisms including mutexes, semaphores, events and timers. The system protects shared data by requiring a thread to gain ownership of a mutex for accessing the data and ... Read More

How to implement monitors using semaphores?

Arnab Chakraborty
Updated on 11-Oct-2019 12:51:49

2K+ Views

To implement monitor using semaphores, for each monitor, a semaphore mutex (which is initialized to 1) is provided. Wait(mutex) must be executed by a process before entering the monitor and must execute signal(mutex) after leaving the monitor. Since a signaling process must wait until the resumed process either leaves or waits, an additional semaphore, next, is introduced, initialized to 0. next can be used by The signaling processes to suspend themselves. An integer variable next_count is also provided to count the number of processes suspended on next. Thus, each external function F is replaced by-wait(mutex); … body of F ... ... Read More

Data parallelism vs Task parallelism

Arnab Chakraborty
Updated on 11-Oct-2019 12:42:35

24K+ Views

Data ParallelismData Parallelism means concurrent execution of the same task on each multiple computing core.Let’s take an example, summing the contents of an array of size N. For a single-core system, one thread would simply sum the elements [0] . . . [N − 1]. For a dual-core system, however, thread A, running on core 0, could sum the elements [0] . . . [N/2 − 1] and while thread B, running on core 1, could sum the elements [N/2] . . . [N − 1]. So the Two threads would be running in parallel on separate computing cores.Task ParallelismTask ... Read More

Advertisements