Re: Question about kernel timers

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

 



Lee Revell wrote:
> On Tue, 2006-07-25 at 18:01 -0400, Lee Revell wrote:
> > I've found that the kernel Oopses if you allocate a timer on the
> > stack, so I use kmalloc().  It seems to work, but leaks memory, as
> > there's no opportunity to free() all the timer_lists I'm creating on
> > the fly.
> 
> I've solved this problem by passing a pointer to the struct timer_list
> to the timer function, and kfree()ing it at the end.  It seems pretty
> ugly but it works.

When the device is closed, you have to cancel all timers (or wait for
them to finish), so I think you have to put them into a list or
something like that.

Is there an upper bound on the number of timers?

Another possibility would be to use one timer and to write your own
event handling logic, but this is probably not worth the effort.


Regards,
Clemens

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux