This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Improvements to fork handling (4/5)


Hi all,

This patch rewrites dll_list::load_after fork. The new version eliminates reserve_upto() and release_upto(), which were expensive (the process repeats for each dll) and buggy (release_upto could free allocations reserve_upto did not make). Instead, the effect of reserve_upto is achieved by recursively attempting to load each dll in its proper place and calling reserve_at before retrying; each reservation's location is kept on the stack throughout and release_at calls are made only when the recursion unwinds after all dlls have loaded. Further, the code (again exploiting image introspection from patch #2) pre-reserves all space needed by each DLL_LOAD before starting the normal load process. This allows us to detect early whether Windows clobbered something from the start (allowing retry) and also ensures that the needed address space is not clobbered by later calls to reserve_at or by dlls allocating resources.

Ryan

Attachment: fork-dll-load.patch
Description: Text document

Attachment: fork-dll-load.changes
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]