alarm() on PC/MSoft (long)
mikeg at rocketmail.com
Tue Nov 4 17:50:37 PST 1997
---"John D. Gwinner" <gwinner at northnet.org> wrote:
> > > I need some second opinion from the win32
> > > there about my ideas about how to implement
> > > like functionality.
> > >
> > > 1. Kaffe will run as a thread in a process were
> > > thread will coexist, in win32 domain, for the
> > > purpose of waking up every slotTime time and
> > > the context switch between threads. From the
> > > thread this is completly async.
> > Quite aside any great expertise on my part, it
> > better to use solution 1 instead of solution 2.
> > Kafe VM should be a single process under Win32.
> > If you launch some sample Java app with Sun's VM,
> > then use Process Viewer application, you will see
> > only one new process is created - JAVA.EXE.
> Under Win32 process != thread ... (just a reminder
for the list) Threads
> are much lighter weight than a process. Each
process has it's own address
> space and VM, so it's hard to send things between
processes unless you use
> the proper Win32 access mechanisms.
> So I'd tend to think 1 would be better anyway.
> It would be very nice if the threads could be
replaces with Win32 threads,
> but this may be more work than is necessary.
> Or -- you could use the winmm timers (no Winloop
needed) or even (gasp)
> the VSync (vertical retrace) but if it can be
fitted in there, a message
> loop would be nice, as you could handle some events
(like a shut down, or
> graphics) a bit better, I think.
> How does the 'wakeup' work? You can implement this
nicely with a timer
> thread and a semaphore.
No, I mean virtual wakeup. The timer thread will issue
a SetTimer() and then wait for the timeout message.
When message arrives the code calls alarmException,
then rearm itself and then go to sleep waiting for the
next timeout message.
Sent by RocketMail. Get your free e-mail at http://www.rocketmail.com
More information about the kaffe