Sponsored Content
Full Discussion: I need your help.
Operating Systems Solaris I need your help. Post 302233309 by matrixmadhan on Sunday 7th of September 2008 04:26:03 AM
Old 09-07-2008
Sorry, if that was such a bad reply.

Truly, the problem in statement is "check for every 'n' units of time". If it has to be checked for 'n' units of time then for the each slice of time the file has to be definitely opened, parsed through, validated or checked against and then closed again.

This has to be definitely done by a process. Using crond for that is ruled out ( as said by you ). So, another process that does a minimal of crond ( a real minimal ) is needed.

Whats wrong with the suggestion I had posted ? For every 'n' units of time, the process is going to wake up and going to do its job; rest of the time it would be in sleep mode so its not blocking the run queue of the runnables nor using up a considerable time slice in doing not-so useful while (1) or something like that.

Any, event tracker or event notifier has to work with the resource ( open, read, close ) and then inform the process blocking on the event notifiers/trackers.

Or, did you mean something else ?

Experts here might post different and better solutions Smilie
 
SDL_SetEventFilter(3)						 SDL API Reference					     SDL_SetEventFilter(3)

NAME
SDL_SetEventFilter - Sets up a filter to process all events before they are posted to the event queue. SYNOPSIS
#include "SDL.h" void SDL_SetEventFilter(SDL_EventFilter filter); DESCRIPTION
This function sets up a filter to process all events before they are posted to the event queue. This is a very powerful and flexible fea- ture. The filter is prototyped as: typedef int (*SDL_EventFilter)(const SDL_Event *event); If the filter returns 1, then the event will be added to the internal queue. If it returns 0, then the event will be dropped from the queue. This allows selective filtering of dynamically. There is one caveat when dealing with the SDL_QUITEVENT event type. The event filter is only called when the window manager desires to close the application window. If the event filter returns 1, then the window will be closed, otherwise the window will remain open if pos- sible. If the quit event is generated by an interrupt signal, it will bypass the internal queue and be delivered to the application at the next event poll. Note: Events pushed onto the queue with SDL_PushEvent or SDL_PeepEvents do not get passed through the event filter. Note: Be Careful! The event filter function may run in a different thread so be careful what you do within it. SEE ALSO
SDL_Event, SDL_GetEventFilter, SDL_PushEvent SDL
Tue 11 Sep 2001, 22:59 SDL_SetEventFilter(3)
All times are GMT -4. The time now is 05:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy