Hello list,
I'd like to create a scheduler for a program I'm writing.
I'm running the program in one main loop.
The program runs a pulse function which checks for incoming connections etc, 
then it needs to run a scheduler.
This scheduler will also have a pulse function, but here's what I'm trying to 
set up.
I want the scheduler to call a function that is defined.
So, a user could add an event that should be ran, and it will just have a 
callback pointer.
Now, here's the question.
I need to find a good clean mechenism for keeping track of what should be 
fired, when.
I can store the time in a timeval struct, but then how would I easily compare 
to see what should be ran?
I've also got another question.
A friend recommended I use a database-like approach, but I'm wondering if 
anyone has any other ideas.
In this program, I will need to store user information.
I plan on creating one file per user, which will look something like:
struct user {
char name[40];
char password[256];
unsigned int fconnect_time;
};
Now, I can easily write this to the users file, but lets say I want to add a 
field with lconnect_time.
I could easily add this to the struct and write my code to use this, but is 
there an easy way to manage all the out of date user files?
TIA,
Tyler Littlefield


[Non-text portions of this message have been removed]

Reply via email to