signal implementation

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"?
 
A

Alan Illeman

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top