Re: How do I cancel a timer?

2008-12-19 Thread Space Ship Traveller
On 20/12/2008, at 5:10 PM, Marc Lehmann wrote: On Fri, Dec 19, 2008 at 08:44:07PM +, James Mansion > wrote: because the design decision to have the multiple-init bug undetectable is effectively made. I'm just objecting to Mr Lehman's characteristically condescending and heavy-handed 'i

Re: How do I cancel a timer?

2008-12-19 Thread Marc Lehmann
On Fri, Dec 19, 2008 at 08:44:07PM +, James Mansion wrote: > because the design decision to have the multiple-init bug undetectable is > effectively made. I'm just objecting to Mr Lehman's characteristically > condescending and heavy-handed 'its not possible'. You'd be well-advised to read

Re: How do I cancel a timer?

2008-12-19 Thread Space Ship Traveller
That part was left as an exercise for the reader I thought it was fairly obvious the pitfalls of this approach. Anyway, good to have it in black and white :) Regards, Samuel On 20/12/2008, at 11:33 AM, James Mansion wrote: Space Ship Traveller wrote: This code is very quickl

Re: How do I cancel a timer?

2008-12-19 Thread James Mansion
Space Ship Traveller wrote: This code is very quickly thrown together to show a basic idea, it obviously won't work in its current form. And you have fallen directly foul of the point that Marc made about that being unreliable. You have to ensure that 'initialized' is 0 before the first call

Re: How do I cancel a timer?

2008-12-19 Thread Space Ship Traveller
This is a bit of a pointless discussion. If you have a problem managing your memory, why don't you write your own wrapper. struct my_ev_watcher { int initialized; ev_timer timer; }; void my_ev_init_timer (struct my_ev_watcher * w) { if (w->initialized)

Re: How do I cancel a timer?

2008-12-19 Thread James Mansion
Brandon Black wrote: The problem with an initialization flag byte is this then requires that the memory being passed to the init function be zero-d (or at least, the flag byte within it be zero-d), Well, I'd question whether its a problem (certainly not from any performance perspective) but sin

Re: How do I cancel a timer?

2008-12-19 Thread Marc Lehmann
On Fri, Dec 19, 2008 at 06:19:37PM +0200, Graham Leggett wrote: >> Well, upo your ass, go elsewhere then, I won't help you anymore. > > As you said, you are starting to get needlessly insulting. Well, it was correct when I said it, it no longer is correct when you parrot it. > Can we keep focus

Re: How do I cancel a timer?

2008-12-19 Thread Marc Lehmann
On Fri, Dec 19, 2008 at 01:00:53PM +0200, Graham Leggett wrote: > In theory, it shouldn't matter how many times you init the timer, a stop > should stop it. Unfortunately, the real world works diferently than your theory, and the designers and authors of libev opted to folow a theory that clos

Re: How do I cancel a timer?

2008-12-19 Thread Graham Leggett
Marc Lehmann wrote: And you are starting to get needlessly insulting. Well, upo your ass, go elsewhere then, I won't help you anymore. As you said, you are starting to get needlessly insulting. Can we keep focus on the problem at hand? Regards, Graham -- smime.p7s Description: S/MIME Cr

Re: How do I cancel a timer?

2008-12-19 Thread Marc Lehmann
On Fri, Dec 19, 2008 at 06:12:51AM +, James Mansion wrote: > That's not necessarily true. Just have a signal byte at a known offset First of all, please do other people a favour and don't send such horribly misformatted messages like yours. Remember that other people might want to read yo

Re: How do I cancel a timer?

2008-12-19 Thread Marc Lehmann
On Fri, Dec 19, 2008 at 01:52:30AM +0200, Graham Leggett wrote: > This is so nineties, seriously :) And you are starting to get needlessly insulting. > C is not a difficult language at all, and it doesn't have to be. Right, but you apparently make it one. > A well written well structured libr

Re: How do I cancel a timer?

2008-12-19 Thread Graham Leggett
ryah dahl wrote: libev is a performance-oriented library; since allocations can be a bottleneck and can be handled in many different ways, the library uses a common pattern and gives memory control to the user. Perhaps the user wants to allocate only a fixed number of watchers statically, perhap