Re: Unix Semaphors and IDS 7.3
Posted in 1999
Topics: Platform-Specific Issues, Versions, Editions & End-of-Life
It does depend on what is happening. Ignoring the Informix specifics and considering what the OS is doing , then are two fundamental semaphores, mutual exclusive. As the name suggests prevents to processes accessing the same resource at the same time. When the resource is to be locked is initialised the semaphore associated with it is set to 1. When the first process wishes to access resource a P operation is carried out, ie it is entering a critical section. The semaphore is set to zero. The second process finding the semaphore set to zero must wait. When the first process completes it's task it performs a V opersion and set the semaphore back to 1 allowing the second process access producer consumer: These are used by co-operating processes one producing data and one using the result. Producer consumer relationships use semaphore to indicate when the data is available. Upon initialisation the producer sets the semaphore to 0, ie no data ready. When the consumer starts it performs a P operation ie give me some data. When the producer has data it performs a V op and the consumer is able to use the data. In both these we have single semaphore controlling single resources. However there is no reason why the semaphore can just be 0 or 1. If it is a positive integer it indicates how much resource is available eg the buffer pool semaphore set to 20 indicates there are 20 buffers available. Each time a process uses a buffer the counter is decremented (a P operation) until the semaphore is zero and which point it waits. On completion the process performs a V op and releases the buffer back to the buffer pool. There is also a mechanism that allows the setting of multiple semaphores on multiple resources in a 'all or nothing' manner. Because the IPC facilities in SVR4 were all inherited from SVR3 they are all static resources, hence all the tuneable parameters that are available for the IPC side of Unix. But the number of semaphores required to control a resource should be constant across identically configured kernels running on identical hardware platforms. Vary the platform and the under lying kernel code might mean that the number of semaphores change although you are doing exactly the same thing. Paul Watson WF Software Ltd Tel: +44 1436 674729 Fax: +44 1436 678729 www.wfsoftware.com/informix # If you broke it, hide the evidence >>> Thomas Mieslinger <thomas.mieslinger@germanparcel.de> 08/23/99 09:00AM >>> Hi, I'd like to know how Informix decides how to allocate Unix Semaphors. I saw Servers that allocated 25 Semaphors per Semaphor identifier and others that took a 100 per identifier. I'm using Solaris 7 x86 and Online 7.31UC2. TIA Thomas ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This footnote also confirms that this email message has been swept by MIMEsweeper for the presence of computer viruses. www.mimesweeper.com **********************************************************************