[ros-kernel] APCs and recent bugs

Lucio Diaz reactos_translate at yahoo.es
Tue Sep 14 18:58:03 CEST 2004


Gé

It seems that when running any aplication (amaya,
winzip) the system will crash in a matter of minutes,
and the debug output "looks like" from my lack of
knowledge as a lack of memory due to processes that
dont clean their memory space.

¿Coul this be related to the APCs bug?, dont know,
probably you know more than myself (the most i can
code is a bit of delhi/pascal).


I found this information at
http://www.lambdacs.com/cpt/FAQ.html#Q404
"AsynchronousInterruptedException (AIE) and POSIX
cancellation:

 
BTW. I noticed a discussion thread from a couple of
months ago regarding
AsynchronousInterruptedException (AIE) and POSIX
cancellation. FYI you can
not use pthread_cancel to implement the async
interrupt. AIE is just an
exception (with some special propagation features) and
can be caught. As
always with Java, interrupt implies cancellation of
the work not the worker.
It *may* lead to the thread terminating but it doesn't
have to. In contrast
POSIX cancellation is termination of the thread. You
can still subvert a
POSIX thread by going off and doing arbitrary stuff in
one of the
cancellation handlers, but it would be very difficult
(I'd almost say
impossible) to map the exception based mechanism over
that - you still have
to deal with finally blocks, lock releasing etc as the
call stack unwinds.
Cheers,
David"


I also did find the next text:
"Termination Waiting

The other aspect of multithreading is waiting for
threads. Threads are maintained uniformly by the
kernel under Windows NT. The threads inform the system
when their state is changed. The state could either be
signaled or unsignaled. Threads are referenced by
handles. A handle is a 32-bit positive integer that
Windows uses to identify a window or another object,
such as a font or bitmap. On opening a handle, the
Windows NT kernel realizes that references to an
object have been made. Therefore, the object is not
removed from memory as long as there are references
made to it. The CloseHandle function releases all
references. When a process terminates Windows NT uses
the CloseHandle function implicitly to close all
handles. An object is destroyed when the last handle
is closed. The application used must close all handles
implicitly because system resources are unnecessarily
used up. The only way to determine if a handle to a
thread can be safely closed is by waiting for the
thread to terminate. 
"



And also found some sources about APCs and
workarounds:

http://www.cmkrnl.com/arc-userapc.html
http://www.codeproject.com/threads/QueueUserAPCEx.asp
(here some source code)

http://www.usenix.org/publications/library/proceedings/usenix-nt98/full_papers/thornley/thornley_html/thornley.html

http://resource.intel.com/telecom/support/Documentation/unix/rel2_openserver/htmlfiles/gcapi/0387-03-21.html
(this one looks quite interesting)

www.mindfiresolutions.com/download/Porting=Unix-NT.pdf


www.nku.edu/~hauserj/ch5_hauser.ppt

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnucmg/html/UCMGch09.asp

http://www.linuxgazette.com/issue23/flower/threads.html
(also interesting)

>From this sources maybe the solution is that the
kernel thread (remember NT is a one-one system)
manages the cleanup of process 10, once awakened by
the deasparition of all handles.

------------------------------

I am only a hobby programmer (not even that), so you
will extract a better conclusion than i can.

Lucio Diaz.


		
______________________________________________
Renovamos el Correo Yahoo!: ¡100 MB GRATIS!
Nuevos servicios, más seguridad
http://correo.yahoo.es


More information about the Ros-kernel mailing list