LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 10-31-2007, 05:14 AM   #1
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 282

Rep: Reputation: 41
Exclamation Will this sequence execute properly?


Hello everyone,

Here is the algorithm of my problem.

1. A file, fd, is opened.
2. A task is created in user space.
3. It registers a signal handler (with sigaction) for the signal SIGIO and maps it to fd (with fcntl)
4. Task enters ioctl.
5. Inside kernel space, task invokes kill_fasync.
6. Task calls schedule()
7. Signal handler will be executed immediately?

I am not sure if the signal handler will be executed immediately OR the task will not schedule anything thus resuming execution?

Apparently my signal handler is not executing, but why is this so? Can't the signal handler in the user space be scheduled?

Thank you very much in advance!
 
Old 11-01-2007, 08:07 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: Slackware64 13.37, Kubuntu 10.04
Posts: 2,944

Rep: Reputation: Disabled
Does the signal get generated if I/O is already possible? Maybe you already have access to the file, so the signal isn't generated.
ta0kira
 
Old 11-02-2007, 05:57 AM   #3
archieval
Member
 
Registered: Apr 2007
Location: Philippines
Distribution: Kubuntu, Ubuntu, CentOS
Posts: 282

Original Poster
Rep: Reputation: 41
Hey its you again! ^_^ The signal is generated through kill_fasync, it is just for notification only when the data processing is done in the kernel space.

Apparently on testing this, the signal handler is not called at the moment of the signal. Instead, the kernel space resumes on executing its remaining work. Is it possible to have the kernel be interrupted for a moment, execute the signal handler, then return to its execution?

I am doing this method to somewhat notify the user about something via signal. The signal handler will work like a callback function that will be executed anytime it receives kernel notification (signal).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to make keyboard sequence execute a command in Xorg ghrellin Linux - Software 1 09-02-2005 10:18 AM
System won't boot properly knoppix doesn't initialize properly rodewan Linux - Software 0 01-23-2005 03:35 PM
boot sequence kermit Linux - Newbie 3 12-10-2004 01:41 AM
Suse 9, RH9 wont install properly. Mandrake 9 wont boot properly? Help. l2ich84 Linux - Newbie 1 01-31-2004 11:02 AM
boot-sequence boku Linux - General 1 08-04-2002 06:50 PM


All times are GMT -5. The time now is 06:12 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration