473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Semaphore Error

Hello all,

I m facing an interesting problem related to semaphore in php.

We are using a huge business application running on LAMP. For database
operations we are maintaining centralized DB manager classes in php
which perform all the single table related activity. Before inserting
new record we are acquiring semaphore on specific key (all the tables
are having seprate sem keys), insert the record and release the
semaphore.
From past few days we are getting error "Warning: sem_get()

[function.sem-get]: failed for key ___: No space left on device", i've
gone to linux console check thru ipcs command whether semaphore is
there or not ?? ___ sem was there i've removed that by ipcrm, it
started working.

Now the problem is, I m acquiring sem on key say 774, then i m not able
to use sem keys 775, 776, 777 etc, I really dont know the reason.

I've made one test page having a loop in which i'd tried to acquire
semaphore from a certain range starts from 10 to 200, i also display
the result whether semaphore acquire is succeed or not..?? I've
executed the script and got the random result. on some keys i've
succeed and on some i've got problem with the above error message.

I'm searching the problem on google but i m not getting proper
solution. Can anyone has faced the same or related problem like this?

Thanks
Rushik.

Oct 27 '05 #1
1 2619
rushik wrote:

We are using a huge business application running on LAMP. For database
operations we are maintaining centralized DB manager classes in php
which perform all the single table related activity. Before inserting
new record we are acquiring semaphore on specific key (all the tables
are having seprate sem keys), insert the record and release the
semaphore.

Why? MySQL is quite capable of isolating DML operations.
From past few days we are getting error "Warning: sem_get()

[function.sem-get]: failed for key ___: No space left on device", i've
gone to linux console check thru ipcs command whether semaphore is
there or not ?? ___ sem was there i've removed that by ipcrm, it
started working.


(/me does not like IPC)

How many semaphores have you got in use? It might be useful to include (a
sample of) the output of ipcs or 'cat /proc/sysvipc/shm'. AIR there are
hard limits compiled into the kernel.
Now the problem is, I m acquiring sem on key say 774, then i m not able
to use sem keys 775, 776, 777 etc, I really dont know the reason.


eh? I've only seen mapping filenames to keys using ftok.

HTH

C.
Oct 29 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: dede | last post by:
Dear community, having written a working example for using Semphores on a windows client, I created a little "server-application" that does the following: A Server continously "listens/tails"...
4
by: Margie | last post by:
Hi, has anyone gotten the error "semaphore timeout" when trying to do a backup to disk? The disk is a logical partition. There are two drives, c: and d:. Backing up to c: is fine. However,...
32
by: William Stacey [MVP] | last post by:
Here is the link. If you find an issue or think of a feature, please post a reply or send an email. Cheers! http://www.mvptools.com/doco/csharp/semaphoredjikstra.htm -- William Stacey, MVP
5
by: marvind | last post by:
I tried using a Semaphore class (have included the full listing reproduced from article Figure 1 at the end of this email) in .NET 1.1. It works fine most of the time, however, I see the following...
5
by: Unni | last post by:
Hello all, I m facing a memory related problem with semaphores. Our business application uses semaphores extensively and the limit imposed by the OS on the number of semaphores that can exist on...
2
by: techi_C | last post by:
Hi I'm getting a problem while removing semaphore from system. Before removing semaphore I'm checking the usage count of a smaphore. // checking usage count usage_count =...
1
by: cranfic | last post by:
Please help... To make it simple, I have a simple test C program which calls my semphore library functions only. (It doesn't call any db2 function at all). And the following is the test...
0
by: Samuel R. Neff | last post by:
I'm having trouble creating a Semaphore with read-access rights for everyone. Originally I was trying to use this code: semaphore = new Semaphore(maxLocks, maxLocks, "RwLock#" + name); but...
5
by: GHUM | last post by:
hello, in my application I am using hSem = win32event.CreateSemaphore (None, 1, 1,"stringincludinginterfaceandport") rt=win32event.WaitForSingleObject (hSem, 0) if rt !=...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.