LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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
  Search this Thread
Old 09-04-2008, 09:52 AM   #16
linuxdoniv
Member
 
Registered: Mar 2008
Posts: 63

Original Poster
Rep: Reputation: 15

I wanted to check the type of application based on the entries in /proc/pid/status.

@Mr.C could you please elaborate why I may not be able to get notified on every exec.

Thanks in advance..
 
Old 09-04-2008, 05:52 PM   #17
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
I was assuming a signal model, where your user-space program receives a signal when an exec occurs. Multiple exec's will result in only 1 signal posted to your process. If multiple exec's occurred before your process had a chance to run you can't distinguish between 1 or 20 exec's - you get only 1 signal.

A model where you create a queue of exec'd process names could work, and a signal could be used to notify you that data is available in the queue. You'd read the entire queue. Alternate methods could be employed (you could create a driver, which allows your user-space app to select/poll/epoll awaiting data to accumulate.

The key point to these implementations is your process receives "notifications" only *when* it is actually running on the processor, and the notifications may be single notify, multiple execs.

Consider, by defintition, when an exec occurs, it is some *other* process that is running at that moment, not your process, which is likely sleeping.
 
Old 09-07-2008, 07:08 AM   #18
linuxdoniv
Member
 
Registered: Mar 2008
Posts: 63

Original Poster
Rep: Reputation: 15
Hi Mr.C

Thanks a lot for that detailed explanation...

I would try to implement the scheme that you mentioned...
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
notified of ip address change taltman Programming 7 07-28-2007 02:36 AM
monitor processes to be notified when a new process is started? cfh Programming 2 10-03-2005 07:07 PM
Number of Mysql processes ugob Linux - Software 0 12-05-2003 01:33 PM
how to change number of running processes rsc Linux - Newbie 2 03-14-2002 05:23 PM
how to change number of default processes rsc Linux - Networking 2 03-13-2002 01:22 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration