[Wine] Re: Running an .NET 1.1 Program

Timeout wineforum-user at winehq.org
Fri Mar 21 01:29:07 CDT 2008


Maybe you are right. I just found this information on an interview about the release of the .NET when I was looking for this error myself.
I would not even recognize a VB .NET application even if it were in front of my nose.

quote:

It seems that there is.  The Windows VirtualAlloc function allows us to specify that the allocated region should be "write watched" (using the MEM_WRITE_WATCH flag) so that further writes to it will be recorded and can then be retrieved using the GetWriteWatch API.  The granularity of the watch, naturally, is in pages, so it requires more work on the garbage collector's side after determining that the area has been written to, but it seems that the performance gains (from not using the JIT-generated write barrier thunk) should be more significant.

The question I was talking about, then, is why doesn't the .NET GC use this built-in memory watch mechanism, supplied by the Win32 API?  The following blog entry notes this possibility (in section 3.2.4), but does not elaborate regarding the reasons behind the particular choice made in .NET.  I have several speculations (which are just that - speculations) and am still pursuing a more definitive answer:

    * The aforementioned API is not supported on Windows 95 (which is, perhaps, not so surprising), but it is not supported on Windows 2000 as well.  This would limit the .NET framework's compatibility with these platforms (although in those particular cases the JIT-thunk approach could be adopted).
    * The aforementioned API is Windows-specific and does not provide any compatibility with other platforms.  The JIT-generated write barrier is generic and theoretically can work on any platform.
    * The performance penalty of using the MEM_WRITE_WATCH flag for writing to a region of memory is bigger than the thunk generated by the JIT.  Note that a very primitive measurement I've performed indicates an 8% performance penalty when writing to memory protected by a write watch as opposed to writing to memory that is not protected by a write watch (don't quote me on this :-)).
 End of quote
http://blogs.microsoft.co.il/blogs/sasha/archive/2007/02/09/Fun-with-the-.NET-GC_2C00_-Paging_2C00_-Generations-and-Write-Barriers.aspx







More information about the wine-users mailing list