iDebD_gh
iDebD_gh

Reputation: 374

Is there any way to send signal to a thread from another process?

I want to send a signal from a process to a thread that is created from another process (that have not created the thread.

What I know about this that:

Is there any way to send signal to a thread from another process?

Hope I am clear!!! NOTE: I am new to unix and threading

Upvotes: 0

Views: 1767

Answers (2)

cnicutar
cnicutar

Reputation: 182609

There is an appropriately named tkill(2):

tkill, tgkill - send a signal to a thread

tgkill() sends the signal sig to the thread with the thread ID tid

You can get a tid using gettid(2).


Beware: the concept of a TID and therefore everything having to do with one is Linux-specific.

Upvotes: 1

Ansh David
Ansh David

Reputation: 672

You Should Read About

  1. pthread_signal()

Should set you in the right direction

Upvotes: 0

Related Questions