Thank you sir, your example is simply super, it gave me a clear understanding on semaphore concept. Thanks once again for your advice.