Re: [fpc-pascal] Solution for Timer in daemon

2013-03-02 Thread Mark Morgan Lloyd
Michael Van Canneyt wrote: On unix, an alternate solution is to use fpSelect (Function fpSelect(N:cint;readfds,writefds,exceptfds:pfdSet;TimeOut:PTimeVal):cint; ) and specify a time-out value. I would go for this. With the very minor caveat that different variants of fpSelect() hide the OS-

Re: [fpc-pascal] Solution for Timer in daemon

2013-03-02 Thread Michael Van Canneyt
On Sat, 2 Mar 2013, Ludo Brands wrote: On 03/01/2013 07:10 PM, Krzysztof wrote: Hi, I'm reading that I can't use timer in daemon because daemon core is based on thread. daemonapp is using threads but nothing stops you from daemonizing your app yourself with a simple fork. The threads are

Re: [fpc-pascal] Solution for Timer in daemon

2013-03-02 Thread Ludo Brands
On 03/01/2013 07:10 PM, Krzysztof wrote: > Hi, > > I'm reading that I can't use timer in daemon because daemon core is > based on thread. daemonapp is using threads but nothing stops you from daemonizing your app yourself with a simple fork. > So I'm trying to create another thread which simul

Re: [fpc-pascal] Solution for Timer in daemon

2013-03-01 Thread Sven Barth
On 01.03.2013 21:17, Krzysztof wrote: I know how sleep blocking works in thread :) . I'm just wondering what is better, sleep or RTL event or something else You might know, but we answered to Leonardo who does not seem to know ___ fpc-pascal maillist

Re: [fpc-pascal] Solution for Timer in daemon

2013-03-01 Thread Krzysztof
I know how sleep blocking works in thread :) . I'm just wondering what is better, sleep or RTL event or something else ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Solution for Timer in daemon

2013-03-01 Thread Mattias Gaertner
On Fri, 1 Mar 2013 10:28:20 -0800 (PST) Leonardo M. Ramé wrote: >[...] > > Well, as far as I know, sleep is no thread safe, it will block your app. sleep blocks only the thread. Mattias ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org htt

Re: [fpc-pascal] Solution for Timer in daemon

2013-03-01 Thread Sven Barth
On 01.03.2013 19:28, Leonardo M. Ramé wrote: From: Krzysztof To: fpc-pascal Sent: Friday, March 1, 2013 3:10 PM Subject: [fpc-pascal] Solution for Timer in daemon Hi, I'm reading that I can't use timer in daemon because daemon core is based

Re: [fpc-pascal] Solution for Timer in daemon

2013-03-01 Thread Leonardo M . Ramé
> > From: Krzysztof >To: fpc-pascal >Sent: Friday, March 1, 2013 3:10 PM >Subject: [fpc-pascal] Solution for Timer in daemon > > >Hi, > > >I'm reading that I can't use timer in daemon because daemon core is based o

[fpc-pascal] Solution for Timer in daemon

2013-03-01 Thread Krzysztof
Hi, I'm reading that I can't use timer in daemon because daemon core is based on thread. So I'm trying to create another thread which simulate timer. My interval is quite big (~1-5 minutes), so I can't just use sleep(6) because daemon will hung on terminate. So I have two ideas: 1. Create loo