Lisp HUG Maillist Archive

RE: OpenGL and rotation

> Thanks Peter, that cleared my flickering problem, but parts 
> of my objects are still dissapearing, any idea what might be doing that?

Is it the parts furthest from the camera? Perhaps the "far clipping plane"
is too close?

Try increasing the last value passed to glu-Perspective...

Cheers,
Claudio

Certain disclaimers and policies apply to all email sent from Memetrics.
For the full text of these disclaimers and policies see
http://www.memetrics.com/emailpolicy.html


timers

Hello,

I'm calling a C program from a timer. This C programm is Lisp friendly and
outputs its result as an sexpr so I just have to call read to get it.

Here is the function I use for this.

(defun exec-kof (command)
  (let ((stream (system:open-pipe *kof-exe*))
 (result nil))
    (when stream
      (unwind-protect
    (setf result (read stream))
 (close stream)))
    result))

The problem is that READ is a blocking call and that the LW IDE is frozen
each time the timer fires. And if I try to open a LW menu, the IDE is
completely frozen and I have to kill the process.

Any ideas to do this ?
Are timers real processes or should I manually start a process to do this ?
Is there a better way to do this ?

I could try to open the pipe in a timer call then read the data in the next
timer call but it's not very clean.

Marc


Re: timers

"Marc Battyani" <marc.battyani@fractalconcept.com> writes:

> Any ideas to do this ?
> Are timers real processes or should I manually start a process to do this ?

As Nick pointed out, they fire in the Idle process.

> Is there a better way to do this ?

I'm not sure. It depends on your needs (e.g. how fine-grained your timing
needs are). If you're not doing this *very frequently*, why fire off
a process from the timer to do the real work?

I can tell you how I do timed execution: I have a "cron in lisp" process
that is similar to the unix cron program, i.e. it consults a global
variable for things to do at every minute, hour, day, week, etc. Then
I have an "at in lisp" process that execute things at specific times.
The latter works by queuing up things to execute in a queue ordered on
execution time. It uses universal time in seconds, so the accuracy is
(at best) within one second.

-- 
  (espen)


Re: timers

>>>>> Marc Battyani writes:

Marc> I need to do this every second.

If it's that frequent, perhaps a dedicated thread which
does mp:process-wait-with-timeout, or sleep, in a loop would be
better?


--
			Alain Picard
			Memetrics


Updated at: 2020-12-10 09:00 UTC