01-08-2014
How to kill a thread among several threads belongs to a process?
I would like to know is there any we can kill a single thread among multiple threads belongs to process?
Since Signal action is process wise not per thread, i strongly feel that we can not or for that mater from external sources as well single thread can not be killed which is critical section and holding mutex.
I got confused after seeing pthread_mutexattr_setrobust() posix thread api.
Which will be used for creating robust mutex to get help when the owner get killed suddenly before release the mutex.
Thanks
--Murali
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hi All,
I am unable to kill a process using kill command. I am using HP-UX system. I have tried with kill -9 and i have root privilages.
How can i terminate this daemon ? ? ?
Regards,
Vijay Hegde (3 Replies)
Discussion started by: VijayHegde
3 Replies
2. UNIX for Advanced & Expert Users
Any idea how to kill threads (not processes) in solaris?
I had checked the man pages for both kill and pkill to no avail. (9 Replies)
Discussion started by: izy100
9 Replies
3. Programming
Hi all
i have simple c program , when i wish to kill the app
im using kill(0,-9) , but it seams this command don't do any thing and the program.
just ignore it .
what im doing wrong here ?
im using HP-UX ia64
Thanks (9 Replies)
Discussion started by: umen
9 Replies
4. Programming
Hi,
I am stuck up with a strange problem.
I am writing an application - a kinda tracker that reads data from memcache and invokes theads to process each record of the memcache.
I dont want to join all my threads because my tracker should poll the cache in regular intervals say sum 300... (2 Replies)
Discussion started by: deepti_v25
2 Replies
5. Shell Programming and Scripting
Sorry, posted the question in other forum. (0 Replies)
Discussion started by: sudhamacs
0 Replies
6. Linux
I want to Kill a process without using kill command as i don't have privileges to kill the process. I know the pid and i am using Linux 2.6.9 OS. (6 Replies)
Discussion started by: sudhamacs
6 Replies
7. Shell Programming and Scripting
Hi Experts, we do have a shell script for Unix Solaris, which will kill all the process manullay, it used to work in my previous env, but now it is throwing this error.. could some one please help me to resolve it
This is how we execute the script (and this is the requirement) ... (2 Replies)
Discussion started by: jonnyvic
2 Replies
8. Programming
Hi all,
Can I create multiple threads using single thread_id
like
pthread_t thread_id;
pthread_create(&thread_id, NULL, &print_xs, NULL);
pthread_create(&thread_id, NULL, &print_ys, NULL);
pthread_create(&thread_id, NULL, &print_zs, NULL);
pthread_join(thread_id, NULL);
what... (2 Replies)
Discussion started by: zing_foru
2 Replies
9. Programming
I have a simple client/server program I am using for learning purposes.
I have it setup so that after server is setup and listening it than goes into a loop where it accepts incoming client connections. After each connection, the client socket is than passed to a thread routine where it can be... (3 Replies)
Discussion started by: Majortom71
3 Replies
10. Shell Programming and Scripting
Good afternoon
I need to KILL a process in a single command sentence, for example:
kill -9 `ps -aef | grep 'CAL255.4ge' | grep -v grep | awk '{print $2}'`
That sentence Kills the process ID corresponding to the program CAL255.4ge.
However it is possible that the same program... (6 Replies)
Discussion started by: enriquegm82
6 Replies
LEARN ABOUT OSF1
pthread_lock_global_np
pthread_lock_global_np(3) Library Functions Manual pthread_lock_global_np(3)
NAME
pthread_lock_global_np - Locks the DECthreads global mutex.
LIBRARY
DECthreads POSIX 1003.1c Library (libpthread.so)
SYNOPSIS
#include <pthread.h>
int pthread_lock_global_np(void);
STANDARDS
None
PARAMETERS
None
DESCRIPTION
This routine locks the DECthreads global mutex. If the global mutex is currently held by another thread when a thread calls this routine,
the calling thread waits for the global mutex to become available and then locks it.
The thread that has locked the global mutex becomes its current owner and remains the owner until the same thread has unlocked it. This
routine returns with the global mutex in the locked state and with the current thread as the global mutex's current owner.
Use the DECthreads global mutex when calling a library package that is not designed to run in a multithreaded environment. Unless the doc-
umentation for a library function specifically states that it is thread safe, assume that it is not compatible; in other words, assume it
is nonreentrant.
The global mutex is one lock. Any code that calls any function that is not known to be reentrant should use the same lock. This prevents
problems resulting from dependencies among threads that call library functions and those functions' calling other functions, and so on.
The global mutex is a recursive mutex. A thread that has locked the global mutex can relock it without deadlocking. The locking thread
must call pthread_unlock_global_np(3) as many times as it called this routine, to allow another thread to lock the global mutex.
RETURN VALUES
If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Successful completion.
ERRORS
None
RELATED INFORMATION
Functions: pthread_unlock_global_np(3)
Manuals: Guide to DECthreads and Programmer's Guide
delim off
pthread_lock_global_np(3)