signal implementation

  • Thread starter Thread starter Mantorok Redgormor
  • Start date Start date
M

Mantorok Redgormor

I have heard that windows doesn't use a signalling mechanism
like unix but instead makes use of message queues

so I am wondering, how is signal(c89/c99 function)
implemented on NT and such(98/XP/LongHorn)?

and how is a process notified exactly of some problem?
for example, if it attempts to dereference a null pointer
constant, how does the OS handle this and notify the process
so that the process can check for whatever message in
the process' message queue?

or does the process just poll randomly for messages in the
message queue and then produce a message like:
"Segmentation fault: unable to access memory at 0x0"?
 
Mantorok Redgormor said:
I have heard that windows doesn't use a signalling mechanism
like unix but instead makes use of message queues

so I am wondering, how is signal(c89/c99 function)
implemented on NT and such(98/XP/LongHorn)?

and how is a process notified exactly of some problem?
for example, if it attempts to dereference a null pointer
constant, how does the OS handle this and notify the process
so that the process can check for whatever message in
the process' message queue?

or does the process just poll randomly for messages in the
message queue and then produce a message like:
"Segmentation fault: unable to access memory at 0x0"?

Each Window process has a message loop, e.g.

while( GetMessage(&msg, NULL, 0, 0))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}

/* do cleanup */
return msg.wParam;
}

...and another process can send a message using e.g.
SendMessage(hWnd, Msg, wParam, lParam) but if the target
process is expecting a pointer in e.g. wParam, it's going
to test for a null pointer, before doing anything with it,
isn't it?
 
Back
Top