[SDL] SDL for a 24/7 machine

Edward Byard e_byard at yahoo.co.uk
Wed Sep 19 02:37:03 PDT 2007


Hi

Nope, no problems with crashes, but in reality my machine is left running for around 30 days at a maximum before something happens and it needs re-booting.

I also use serial comms and have had a few problems, but that's down to Windows <sigh>

I guess it depends what you're doing - my application is a gaming (slot) machine and I have a master 1ms ticker which I use to derive timers for various events, I used the same on embedded systems for many years, with no problems at all.

You might want to consider doing some "quiet-time" housekeeping, i.e. when the machine is not in use for a long period of time, see if anything can be cleaned up, variables reset, etc.

Kind Regards,
Ed

----- Original Message ----
From: "benang at cs.its.ac.id" <benang at cs.its.ac.id>
To: A list for developers using the SDL library. (includes SDL-announce) <sdl at lists.libsdl.org>
Sent: Wednesday, 19 September, 2007 7:48:57 AM
Subject: Re: [SDL] SDL for a 24/7 machine

Thanks.

Can I ask a question? Because you also use it for a 24/7 machine, do you
have occasional crashes? Because that happened to mine. Although the issue
rarely happened, but it usually happens if the machine was run for a long
time. And it always happens when there's an input from the serial port.
FYI, there's a serial modem-like device that will send a sequence of chars
to the program when it was triggered.

Edward Byard wrote:
> I use SDL for a machine which is also on 24/7.
>
> A unsigned long is good for 49 days of use before it wraps, so if your
> machine is re-booted occasionally then you'll be fine. If not, then the
> info already given on here will suffice.
>
> You're not using Windows which is also good news in some ways - if you
> WERE using Windows you'd have to reboot before your 49 days were up as
> it'd probably have fallen over or BSOD...
>
> Ed
>
> ----- Original Message ----
> From: Gerry JJ <trick at icculus.org>
> To: sdl at lists.libsdl.org
> Sent: Tuesday, 18 September, 2007 2:40:17 PM
> Subject: Re: [SDL] SDL for a 24/7 machine
>
> Den Tue, 18 Sep 2007 11:20:59 +0700 (WIT)
> skrev benang at cs.its.ac.id:
>> Hi, I have a problem here. I just found out that my machine will be
>> operated 24/7 non stop. I know that this will make the timing and
>> ticks wrong. My questions are:
>>
>> 1. Anybody know how to handle the ticks if it was run more than the
>> ticks value can handle (Uint32 I believe)? FYI, I used ticks for
>> animation and few other things so it is a crucial issue.
>
> Actually this might not be much of a problem, since differences wrap
> around too thanks to two's complement.  For example:
>
>     Uint32 before = 4294967295;     // = (Uint32)-1
>     Uint32 after = 1;
>     printf("%u\n", after - before); // = 2
>
> So as long as you don't need tick differences bigger than 32 bits you
> should be fine.  If you do need bigger differences for some reason, you
> could accumulate ticks:
>
>     //in stead of SDL_GetTicks() (call somewhat regularly):
>     Uint64 GetTicks64 (void) {
>         static Uint64 ticks64 = 0;
>         static Uint32 lasttick = 0;
>         Uint32 currenttick = SDL_GetTicks();
>         ticks64 += currenttick - lasttick; //works, as above
>         lasttick = currenttick;
>         return ticks64;
>     }
>
> This will still wrap around after 18446744073709551616 ticks though =).
> Apart from that it might work, assuming SDL doesn't otherwise screw up
> things when the 32-bit ticks wrap around.  I don't think it does,
> though.
>
> Also, if you don't do it already, you could consider making your
> program have a fixed logic rate, separate from the video framerate.
> Everything would then depend on "logic ticks" in stead of clock ticks.
>
>> 2. Any other issue that would appear in the 24/7 non stop operation
>> of an SDL application (SDL-wise or Linux-wise)? I know this is a
>> rather abstract question, but I need your opinions and assumptions of
>> what could go wrong so I could recognize the problem beforehand.
>
> Well, Linux should be fine, as long as your program doesn't have
> memory/resource leaks and such.  Don't know about SDL.
>



Fare thee well,
Bawenang R. P. P.

----------------
ERROR: Brain not found. Please insert a new brain!

“Do nothing which is of no use.” - Miyamoto Musashi.

"I live for my dream. And my dream is to live my life to the fullest."


_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org







      ___________________________________________________________
Yahoo! Answers - Got a question? Someone out there knows the answer. Try it
now.
http://uk.answers.yahoo.com/ 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070919/bebc7297/attachment.html 


More information about the SDL mailing list