<URL: https://rt.cpan.org/Ticket/Display.html?id=53914 >

On Sun May 20 13:58:03 2012, bulk88. wrote:
> > I may or may not put
> > this warning into my Win32 API 0.69.
> 
> 
> I'm working on putting the warning in. Its very complicated.
> CallbackTemplate has no jmp codes or branches, and CreateCallback
> doesn't detect or adjust them currently. I think I will be successful
> though.

As of Win32::API 0.69 this will not crash, only a fatal error (see this
code chunk
https://metacpan.org/source/COSIMO/Win32-API-0.72/Callback/Callback.xs#L204
) and possible resource leaks (ExitThread()). Is this a good enough
resolution to the problem or does someone seriously want the Perl interp
to be automatically moved between OS threads? The
GenerateConsoleCtrlEvent API always runs the callback in a brand new OS
thread each time Ctrl-C or synthesized equivalent happens, unlike Unix
signals.

To automatically move the threaded interp between OS threads without an
explicit command to suspend and transfer the interp on a Script level,
reenterancy and race conditions *I think* will make it very unstable.
This would involve adding an "event loop" to Win32::API or integration
with the event loop in the interp's alarm/Windows Messages/Win32 safe
signals system. Does anyone want Win32::API to move the interp between
OS threads or is the fatal error to console enough? If I dont get any
responses in the next couple days or week I will close this ticket as
resolved/fixed (as fatal error in 0.69 rather than previous crash).

Reply via email to