that's ok, i appreciate u, thx :)
Type: Posts; User: sleith
that's ok, i appreciate u, thx :)
i dont understand what did u mean >.<
the 'a' variable is any variable that would like to be synchronized.
usually we may write it like this :
public int Test(){
...
For example i have a class mutex :
class Mutex
{
pthread_mutex_t & mMutex;
public:
Mutex(pthread_mutex_t & m):mMutex(m)
{
pthread_mutex_lock(&mMutex);
i mean if there's two thread using the sig_atomic_t for synchronization instead of mutex.
i have couple of questions about sig_atomic_t
1. if the first declaration variable of sig_atomic_t is 0 (without assigning the 0 value, just declare like sig_atomic_t atomic; )?
2. suppose i have...
I try to send the signal for three times from self or from another program, and the signal SIGSEGV is blockable. Is it different because the system is not really SIGSEGV?
Maybe i should sigaction...
hm.. if SIGSEGV is unblockable, then i should do with your suggest.
ok thanks for your advice mats :)
Yes that's the situation. Of course the program should not produce segfault, but as a programmer i would like to do how to handling such thing if it happens. Btw, what makes my blocking signal code...
the unblocking signal is just to handling in case when other modules using this ipc module is doing SIGSEGV.
So the point is the ipc module is SAFE that guaranteed no segv or another thing happened...
i think i cant do that. Because the process inside the semaphore cannot be partly done.
That's why i think it's better using signal block.
i have a shared memory that used by many module.
To make it safe, of course i use semaphore.
Before calling the semaphore to do the operation, i would like to block the signal (like SIGSEGV) first....
i'm trying to block SIGSEGV, but don't know why the signal is not blocked.
This is my code :
#include <iostream>
#include <signal.h>
#include <errno.h>
using namespace std;
thx for the reply
it's been solved, i did a wrong logic >.<
Hi, im in trouble with nonblocking send. When i set server to nonblocking send, the client is not received all the data, there's something missing. I have used my own buffer to make sure all the data...
Hm..ok2 i undestand now. Thx :D
what i'm trying to do is to test why after i run testing() for 1 time, the memory is not going down (i use top to see my memory). It's supposed to be freed.
But if i run testing() more than 1 time...
this is my code :
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define JUMLAH 1000000
#define ISI 100