[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Time Outs



Hi!

I'll like some advices about how to create a time out in a debian.

I need at least to do 4 different actions, for example: I have 4 threads and each one is going to create some data and store it in a structure (it's not a periodic task and each thread work with different structures and store different kind of data).

So I'd like to erase each data after a X seconds and what I'm going to do is store in a queue the time when I'd like to erase that data and a pointer to the data.

Then using posix-timers, one different for each thread, and using a different signal for each one (SIG_ALRM, SIGUSR1, SIGUSR2,...) I will program them and each one will consult a different queue to erase the data and auto re-programing with a new elapsed time.

I don't like the idea of using posix because I need a new signal each time, and I can't pass any parameter to the function executed when the timer elapse.

I don't know if there are more solutions if there's another way...

Is there anyone who knows how to create better time outs?

Thanks a lot!

_________________________________________________________________
¿Estás pensando en cambiar de coche? Todas los modelos de serie y extras en MSN Motor. http://motor.msn.es/researchcentre/



Reply to: