Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Multithreading and the mutex

I is preparing a http proxy. Some fail. Each received framed in a new client's request to deal with the city to build a connecting thread that links in the process, I use the select request (), set up 10 seconds of overtime. When the return value> 0 will select a thread handling this request, less than 12 a.m. close link. has opened a new thread is to achieve pipelining. This requires the use mutex or other forms of client synchronization socket, as they open a new thread in reply to a request or return to the use of socket when conflicts. I feel like this is not possible to put an overall mutex variable, but each set up a link, Only connect the various requests in each socket will use the conflict there. If every link set up a mutex, how should this statement variables to deal with the request of the thread connecting all how should use it.
Thank you. Called upon to give advice, it is the first time I use multithreading and mutex, what idiots wrong, please forgive me.

Multithreading and the mutex

What in your system, the majority of the volume is based on UNIX signal process.
V semaphore system can be used to achieve the functions you.

Multithreading and the mutex

Linux, but not signal v ah. Mutex can be used to achieve?

Multithreading and the mutex

Can this way?
Pthread_cond_t available_socks = PTHREAD_COND_INITIALIZER;
Pthread_mutex_t item_lock = PTHREAD_MUTEX_INITIALIZER;
Int main () (
...

}
Void *thread_function () (
...
Pthread_mutex_lock (&item_lock);
/*do Somsthing. . . */
Pthread_cond_signal (&available_socks);
Pthread_mutex_unlock ($item_lock);
}

Multithreading and the mutex

Dear paths, if the level is like a thread. This class is a pile of thread and his children. Actually created a thread is the first time all the children sharing a resource, and if this is the first time you can create all the threads.

Multithreading and the mutex

Is not very clear, but with the IPC to solve problems like these children close.

Multithreading and the mutex

Sounds ipc is feasible. Thank you.
But it hopes to achieve over the Supreme pipelining can give pointers about.

Multithreading and the mutex

Use pthread, with the threads pthread_cond_t pthread_mutex_t mutex not to use the Unix ipc semaphore

Multithreading and the mutex

Multithreading and the mutex

Oh, I used to the need to solve the problem because I do not know how to put ipc mutex can be used on the thread child transmission structure



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com