Found 1301 Articles for MCA

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

690 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

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

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

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

What is Amdahl's Law?

Arnab Chakraborty
Updated on 31-Jan-2020 10:48:44

7K+ Views

Amdahl’s LawSuppose, Moni have to attend an invitation. Moni’s another two friend Diya and Hena are also invited. There are conditions that all three friends have to go there separately and all of them have to be present at door to get into the hall. Now Moni is coming by car, Diya by bus and Hena is coming by foot. Now, how fast Moni and Diya can reach there it doesn’t matter, they have to wait for Hena. So to speed up the overall process, we need to concentrate on the performance of Hena other than Moni or Diya.This is ... Read More

What is Multicore Programming?

Arnab Chakraborty
Updated on 11-Oct-2019 12:33:09

5K+ Views

Multicore programming helps to create concurrent systems for deployment on multicore processor and multiprocessor systems. A multicore processor system is basically a single processor with multiple execution cores in one chip. It has multiple processors on the motherboard or chip. A Field-Programmable Gate Array (FPGA) is might be included in a multiprocessor system. A FPGA is an integrated circuit containing an array of programmable logic blocks and a hierarchy of reconfigurable interconnects. Input data is processed by to produce outputs. It can be a processor in a multicore or multiprocessor system, or a FPGA.The multicore programming approach has following advantages ... Read More

Orthogonal Frequency Division Multiplexing (OFDM)

Moumita
Updated on 07-Oct-2019 08:02:17

17K+ Views

In data communications and networking, orthogonal frequency-division multiplexing (OFDM) is a method of digital data modulation, whereby a single stream of data is divided into several separate sub-streams for transmission via multiple channels.OFDM uses the principle of frequency division multiplexing (FDM), where the available bandwidth is divided into a set of sub-streams having separate frequency bands. OFDM was introduced in 1966 by Chang at Bell Labs and was improved by Weinstein and Ebert in 1971.Working Principle of OFDMOFDM is a specialised FDM having the constraint that the sub-streams in which the main signal is divided, are orthogonal to each other. ... Read More

Advertisements