Posts

Showing posts from March, 2009

Difference between semaphore, mutex & spinlock?

Semaphores in Linux are sleeping locks. Because they cause a task to sleep on contention, instead of spin, they are used in situations where the lock-held time may be long.Conversely, since they have the overhead of putting a task to sleep and subsequently waking it up, they should not be used where the lock-held time is short. Since they sleep, however, they can be used to synchronize user contexts whereas spinlocks cannot. In other words, it is safe to block while holding a semaphore. A "mutex" (or "mutual exclusion lock") is a signal that two or more asynchronous processes can use to reserve a shared resource for exclusive use. The first process that obtains ownership of the "mutex" also obtains ownership of the shared resource. Other processes must wait for for the first process to release it's ownership of the "mutex" before they may attempt to obtain it. The most common locking primitive in the kernel is the spinlock. The spinlock

NOR vs NAND

Image
NOR-NAND comparison PARAMETER NOR NAND Capacity 16Mbits  to 1Gb (Toshiba) 512Mbits to 16Gb  (Toshiba) XIP (execution in place / code execution) Yes No Performance Erase Write Read Very Slow  Slow Fast Fast  Fast slow Strengths Addressable to every byte More than 10% higher life expectancy Erase cycle range 10,000 to 100,000 100,000 to1,000,000 Interface SRAM-like, memory mapped Accessed in bursts of 512 bytes; I/O mapped Access method Random Sequential Price High Very low   Pic courtesy Toshiba