Sponsored Content
Top Forums Programming API C MYSQL vs lock table ??? Post 302224025 by JEscola on Tuesday 12th of August 2008 04:19:58 AM
Old 08-12-2008
Question API C MYSQL vs lock table ???

(sorry for my english)

Hi, i have an app that uses MYSQL API C.. i trying do a timeout until the table is locked by an other thread , in the docs of Mysql i can see that MYSQL_OPT_READ_TIMEOUT is not implemented for linux ¿?¿?.. any body knows a way to do a timeout until the table is locked by other process???

my process hang forever if the table is locked...:
 

7 More Discussions You Might Find Interesting

1. Programming

Sendmail & mail.local + MySQL API

I've searched this message board, and the newgroups THOROUGHLY, in search of any information towards implenting the MySQL API with C... I'm a "beginner" to the C language I suppose, and i've made a few functions in C that can be implemented into the source code of Sendmail/mail.local, so that any... (2 Replies)
Discussion started by: CGrusden19
2 Replies

2. Shell Programming and Scripting

MySql: create table error

Hi, iam learning MySql. Iam trieing to create a table in the database "guestbook" at the command line in mysql heres what i type but i get a error mysql>create table guestbook ->( -> name varchar(40) null. -> url varchar(40) null. -> comments ... (3 Replies)
Discussion started by: perleo
3 Replies

3. Shell Programming and Scripting

Help Inserting data in mysql table

Cant understand the error #!/bin/bash temp="" A="" D=$(date +"%Y-%m-%d") H=$(date +"%R") temp=$(wget -q -O - website | grep -o "Temperature:]**" | grep \-E -o "+") mysql -D "weather_wise" -e "INSERT INTO weather (Date, Hour, Degrees) VALUES ($D,$H, $temp)"; my data types for... (11 Replies)
Discussion started by: vadharah
11 Replies

4. Programming

Man pages for C API for MySql

Hi, I am on Ubuntu 9.04 tweaking some programs demanding MySql queries. I got the program working by installing following package: sudo apt-get install libmysqlclient-dev and using proper include and library folder However I was unable to access any man pages for these C api's (Strangely... (1 Reply)
Discussion started by: dheerajsuthar
1 Replies

5. UNIX and Linux Applications

mysql table disappear

I have set a mysql file to excute everyday morning to generate a html file displayng 2 tables from the database. Sometime they cannot be shown, and it shows the tables are not existed. I have not drop any table, and those 2 tables are not used by any other excution. Anybody know what is happening?... (0 Replies)
Discussion started by: c203040
0 Replies

6. Red Hat

MySQL is not running, but lock exists

# service mysql status MySQL is not running, but lock exists I deleted the lock using rm /var/lock/subsys/mysql still the problem persists. I tried using mysqld_safe, still the same issue. Unable to start mysql # mysqld_safe nohup: ignoring input and redirecting stderr to... (3 Replies)
Discussion started by: hiten.r.chauhan
3 Replies

7. Shell Programming and Scripting

How to lock Oracle table through UNIX?

Hi frndz, Can anyone provide me some input or pseudo code for my req as mentioned below... I am loading 2 files through unix script into oracle table...as i am doing some updates also i am getting an error where both files try to update the table simultaneously and my script fails.. so i... (3 Replies)
Discussion started by: gnnsprapa
3 Replies
SEM_TIMEDWAIT(3)					   BSD Library Functions Manual 					  SEM_TIMEDWAIT(3)

NAME
sem_timedwait -- lock a semaphore LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <semaphore.h> int sem_timedwait(sem_t *sem, const struct timespec *abs_timeout); DESCRIPTION
The sem_timedwait() function locks the semaphore referenced by sem, as in the sem_wait(3) function. However, if the semaphore cannot be locked without waiting for another process or thread to unlock the semaphore by performing a sem_post(3) function, this wait will be termi- nated when the specified timeout expires. The timeout will expire when the absolute time specified by abs_timeout passes, as measured by the clock on which timeouts are based (that is, when the value of that clock equals or exceeds abs_timeout), or if the absolute time specified by abs_timeout has already been passed at the time of the call. Note that the timeout is based on the CLOCK_REALTIME clock. The validity of the abs_timeout is not checked if the semaphore can be locked immediately. RETURN VALUES
The sem_timedwait() function returns zero if the calling process successfully performed the semaphore lock operation on the semaphore desig- nated by sem. If the call was unsuccessful, the state of the semaphore is unchanged, and the function returns a value of -1 and sets the global variable errno to indicate the error. ERRORS
The sem_timedwait() function will fail if: [EINVAL] The sem argument does not refer to a valid semaphore, or the process or thread would have blocked, and the abs_timeout parameter specified a nanoseconds field value less than zero or greater than or equal to 1000 million. [ETIMEDOUT] The semaphore could not be locked before the specified timeout expired. [EINTR] A signal interrupted this function. SEE ALSO
sem_post(3), sem_trywait(3), sem_wait(3) STANDARDS
The sem_timedwait() function conforms to IEEE Std 1003.1-2004 (``POSIX.1''). HISTORY
The function first appeared in FreeBSD 5.0. BSD
March 3, 2008 BSD
All times are GMT -4. The time now is 05:05 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy