Found 179 Articles for Windows

Deadlock with mutex locks

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

5K+ 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

618 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

1K+ 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

1K+ 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

14K+ 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

Types of Parallelism in Processing Execution

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

13K+ 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

Local procedure calls in Windows

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

1K+ Views

The message-passing facility in Windows is called the local procedure call (LPC) facility. LPC is used for communication between two processes on the same machine. It is similar to the standard remote procedure call (RPC) mechanism that is widely used, but it is optimized for and specific to Windows. Windows uses a port object to establish and maintain a connection between two processes, like Mach. Two types of ports are used by Windows: connection ports and communication ports.The communication works as follows −Server processes publish connection-port objects that are visible to all processes.When a client wants services from a subsystem, ... Read More

What are the fundamental differences between Windows and Linux?

Arnab Chakraborty
Updated on 11-Oct-2019 12:26:28

404 Views

WindowsThe window operating system is the extension of the disk operating system.Windows is the most popular and simplest operating system which can be used by any person who can read and understand basic English, as it does not require any special training.It requires DOS to run the various application programs initially. So, DOS should be installed into the memory and then window can be executed.LinuxLinux is one of popular version of UNIX operating System which is open source as its source code is freely available. It is free to use and wasdesigned considering UNIX compatibility. Linux’s functionality list is quite ... Read More

Advertisements