segmnetation fault by pthread_mutex_unlock on a successfully locked mutex
Hi Everyone
I have this quite simple "tread" function
I can't unlock the mutex pointed by th_arg->up_neighbour, I'm getting a segmentation fault.The mutex is previously successfully locked, perror prints success.
The aren't any race conditions,since only one thread is created in main()
The struct of arguments passed is declared as global
My log file finishes with line "Segment %d: Before Up_Neighbour Mutex UnLock\n" so I know it's not the critical code section.I even tried commenting out.
I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this :
i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Hi All,
To avoid race condition, instead of using mutex, semaphore, spinlock etc.... Is there any other mechanism by which we can avoid race condition in an multi-threading environment.
-Thanks (6 Replies)
Hello,
I have got some issue with the struct variable with passed arguments
the variable in the sturct is only recognize the last value their assigned to
I'm pretty confused why the mutex didn't work out
here is my program:
#include<stdio.h>
#include<pthread.h>
pthread_mutex_t lock... (3 Replies)
Hi all,
I have a scenario where I need to use the mutex locks. The mutex locks are working fine, but sometimes I am getting into the dead lock situation.
Below is the summary of my code :
MUTEX LOCK
performTask();
MUTEX UNLOCK.
In some cases I get into the situation where... (2 Replies)
I am trying to use mutex in my multi-tread project, but they don't seem to work.
I have created a simple demonstration of the problem. This is NOT how I would use a mutex, only a demonstration of the problem:
#include <stdio.h>
#include <pthread.h>
int main()
{
int val;
... (3 Replies)
Hello Everyone,
I just joined this forum and this is my first post.
I would like to know how can I impliment basic read/write locks in perl. I have a database (file) which can be accessed simultaneously but has to be locked while writing.
If there is no such support in perl, my next... (6 Replies)
A shell in crontab per 5 min write a file
B shell in crontab per 6 min read a file
how to lock the share file a ;avioid confilict in write and read?
Thx : -) (1 Reply)
Hi all,
I am working in a UNIX/C environment. I would like to understand more about MUTEX and Threads. Can someone explain me these
concepts and how they are related.
Vijay (2 Replies)