Hi everybody,
I have a basic question about how to share data between classes. I want to avoid the use of global variables but I'm using semaphore as synchronization object and global counter...
Type: Posts; User: radeberger
Hi everybody,
I have a basic question about how to share data between classes. I want to avoid the use of global variables but I'm using semaphore as synchronization object and global counter...
Hi everybody,
has anyone any ideas to implement a mailbox in c++? I didn't find any classes....
I have an application that implements the consumer producer problem. I'm thinking to use lists...
Hi,
I know it's stupid to have thr1 and thr3 in the same port but I communicate with a machine that use this port (actually I try to change this but at the moment it works so, and no, that's no...
I forgot to say that I need to set priority levels because thread1 and thread3 are using the same ports to send (it works so at the moment with the machine). That is both can want to send at the same...
because that is design requirements, while thread 2 allocate data in memory thread3 can send data to other machine.
windows xp
>> A semaphore with the maximum count to 1 is like a mutex?...
I tried what you say and it works but I tried other thing too: I create the mutex in the second thread function with the second parameter TRUE and the main function takes it. Is that because main...
The thing is that with semaphore I can control what thread begins first but with mutex I don't know how I can do it.
I have two threads:
The first thread is the main function, so it starts first....
Hi everybody,
I'm programming an application with severe dependency conditions between three threads. I want to ask you for ADVICE:
I will try to describe my problem: (Thr1, Thr2, Thr3 are...
Hi everybody,
I found the error. I used the function recevfrom and the last two paramaters are a pointer to a buffer in a sockaddr structure that will hold the source address upon return and the...
thread1 is my main function...
in the main I create the mutex: CreateMutex(NULL,FALSE,NULL) I think with the second parameter to FALSE the main thread doesn't take the mutex the first time. After that I create the second thread...
How can I give the first ownership of a mutex to a thread?
I mean, I have two threads in my applications. thread 2 must wait for thread1 but it doesn't because thread2 runs before and takes the...
I don't want that two threads print out something on the screen at the same time
what would you recommend me to synchronize the cout on the screen? a mutex or a semaphore?
I think it's a synchronization problem because I use a mutex for the screen and I think something is wrong but I can't see it....
Sorry, I wrote something wrong,
the first time it receives port=2000
but the second time=49154 and not 2000
I don't understand why after the TCP connection the destination port of my UDP connection is changed...but I have made debugging and I know that it occurs...
now I have this code
while(AcceptSocket==SOCKET_ERROR)
{
Acceptsocket=accept(socketInTCP,NULL;NULL)
}
socketInTCP=AcceptSocket
while(run_tcpserver)
I don't know. but the destination port is wrong after successively recv...
that is my question....
Hi again,
Now I can describe the problem better
I have a tcp server that wait for data in the recv function after accept. I receive data buffer of 1500 bytes but I don't receive only one...
Hi,
I must use different connections (design requirements...)
Hi everybody,
I have an application where two different socket connections run in order to communicate with a machine. Over the first one (UDP) I send a request packet to ask for data and over the...
shall I show you some code?
Well, it's possible but my problem now is that the thread in the main function stays at the point "WaitForSingleObject()" forever although the other thread have already released the mutex...
When you create a mutex with the second argument BOOL bInitialOwner, TRUE, the ownership goes to the thread who created it. I tried to use it with FALSE but it doesn't work. The thread takes over the...