Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Do UNIX signals produce interrupts? Post 302942825 by Tru69 on Friday 1st of May 2015 02:48:22 PM
Old 05-01-2015
Question Do UNIX signals produce interrupts?

Hi folks!

I have been reading Vahalia's Unix Internals book, which states the following in the chapter dedicated to signals:
Quote:
The receiving process becomes aware of the signal when the kernel calls the issig() function [...] The kernel calls issig() only at the following times:
  • Before returning to user mode from a syscall/interrupt
  • Just before blocking on an interruptible event
  • Immediatly after waking from an interruptible event
Given that, my understanding is that processes running in user mode don't become aware of signals until they switch to kernel mode, where the issig() function is called at some points.

However, he later gives an example where a user would type ctrl+c at a terminal, sending a SIGINT signal to the foreground process. If it happens that this process is running on another CPU, a special "cross-processor" interrupt is needed so that the target sees the signal. But why is that? Do signals actually produce interrupts (traps) to the signaled processes so they immediately see them? Otherwise, wouldn't it be enough to just set a flag in this process' structure, which would be then checked in one of that three situations described before?

Thanks in advance!
 

9 More Discussions You Might Find Interesting

1. Programming

Unix/Linux Newbie(ish) Question - IPC/Signals

:) Hello, i have been given the following code to help me learn how to use signals, it won't compile. The problem maybe because this was written for use in Unix and i am trying to compile in Linux. The error i get says that SIGPIPE and SIG_IGN are undeclared. I think that these are defined... (2 Replies)
Discussion started by: theultimatechuf
2 Replies

2. Programming

Signals in Unix Solaris

I am doing a project to stimulate the scheduing policy of an OS under Unix Solaris. Its something like that: A process, say A will communicate to another process, which is the OS, and then execute the system call, pause(); The stimulated OS will then have to use sigsend(); to send a... (1 Reply)
Discussion started by: heljy
1 Replies

3. Filesystems, Disks and Memory

Does unix use interrupts?

I'm a freshman here and I have a simple question. Does unix use interrupts which is like Dos? Are they the same? Thx.:cool: (6 Replies)
Discussion started by: Frank_M
6 Replies

4. UNIX for Dummies Questions & Answers

catching interrupts

hey i have been facing a problem,can you tell me if we can catch ctrl d in unix i have tried and sucessfully catched and disabled ctrl-c and ctrl -z but am not sure if we can do the same for CTRL-D, so got any clue mail on he forum or ...i mean c programming in Unix thats what i am working on (1 Reply)
Discussion started by: toughguy2handle
1 Replies

5. UNIX for Advanced & Expert Users

Interrupts problems

Hi, My machine is a Unixware 7.1.3 is a files server, and I had never problem with that machine, but since two days, the machine presents slows problems, i think that the problem is te device interrupts, I had checked all and I dont found it any problem. Any idea? Thanks, (sorry my... (2 Replies)
Discussion started by: By_Jam
2 Replies

6. UNIX for Dummies Questions & Answers

Traps and Interrupts

Well, I don't know where exactly to ask this doubt so I'm asking in the newbie section. I was reading about traps and interrupts when I thought of traps as something that cease the control of the OS from the user and interrupts that cease the control yet provide support for multitasking. Am I right... (3 Replies)
Discussion started by: Legend986
3 Replies

7. Linux

How to interrupts work queue with signals

Hi masters, I am doing a project to regulate network bandwidth. I am using workqueue to implement packets management (I uses kernel threads inside each of these work queue) , netfilter hooks to implement packet catcher . All my modules individually works fine . But when I run my workqueues,... (1 Reply)
Discussion started by: iamjayanth
1 Replies

8. UNIX for Dummies Questions & Answers

about concept of Interrupts.

Hi all, I am new here ,i want to know about interrupts in detail.What r Interrupts .how they r handeled. Thanx in adavnce. (1 Reply)
Discussion started by: vishwasrao
1 Replies

9. Shell Programming and Scripting

A question about signals in Unix

Whats a signal 0. An exhaustive search on signals landed me nowhere. Is it possible to do something like this trap "echo $var" 0. If so what signal does this trap catch ? (2 Replies)
Discussion started by: kinny
2 Replies
sigpending(2)							System Calls Manual						     sigpending(2)

NAME
sigpending - examine pending signals SYNOPSIS
DESCRIPTION
stores the set of signals that are blocked from delivery and are pending to the calling thread, at the location pointed to by set. RETURN VALUE
Upon successful completion, returns 0. Otherwise -1 is returned and is set to indicate the error. ERRORS
fails if the following condition is encountered: set points to an invalid address. The reliable detection of this error is implementation-dependent. APPLICATION USAGE
Threads Considerations The set of signals returned by is the union of the signals pending on the process and calling thread. A signal may be pending on the process if all threads block the signal. The set of signals returned by is only advisory. Since other threads may be executing at the time of the call, a signal pending on the process may be delivered to a thread after this system call returns. For more information regarding signals and threads, refer to signal(5). LWP (Lightweight Processes) Considerations The set of signals returned by is the union of the signals pending on the process and calling LWP. AUTHOR
was derived from the IEEE POSIX 1003.1-1988 Standard. SEE ALSO
sigaction(2), sigsuspend(2), sigprocmask(2), sigsetops(3C), signal(5). CHANGE HISTORY
First release in Issue 3. STANDARDS CONFORMANCE
: AES, SVID3, XPG3, XPG4, FIPS 151-2, POSIX.1 sigpending(2)
All times are GMT -4. The time now is 09:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy