alarm() on PC/MSoft (long)

John D. Gwinner gwinner at northnet.org
Tue Nov 4 04:50:49 PST 1997


> > I need some second opinion from the win32 experts out 
> > there about my ideas about how to implement SIGALRM
> > like functionality.
> > 
> > 1. Kaffe will run as a thread in a process were a twin
> >    thread will coexist, in win32 domain, for the
> >    purpose of waking up every slotTime time and do 
> >    the context switch between threads. From the kaffe
> >    thread this is completly async.
> 
> Quite aside  any great expertise on my part, it seems
> 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 that
> 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.

Ironically, I'm being asked to do an irc server port to NT also.  Wish I
could make some money at this!  This putting food on the table thing is
getting to be a hassle, especially with the wife's work (hospital)
threatening to strike.  Anyone need any consulting done?

		== John ==



More information about the kaffe mailing list