Recall that when you create a view of a memory mapped file, Windows aligns the view to virtual memory page boundaries. E.g., if your page size is, say, 4096 bytes, a memory-map view can only be 4096, 8192, 12288, ..., N × 4096 bytes large.As our data file is smaller than a memory page, we get a view that is as large as a memory page (if the size of virtual memory pages on your machine is not 4096, then the output will also differ accordingly). The memory-map view contains the data supplemented with zeros. When we use a stream reader to read this data, we only reach the EOF mark when we get to the end of the entire view, not to the end of the original data.
Friday, May 31, 2013
Memory Mapped File Quirks [Greg] - BCL Team Blog - Site Home - MSDN Blogs
Memory Mapped File Quirks [Greg] - BCL Team Blog - Site Home - MSDN Blogs:
Thursday, May 30, 2013
Awaiting Socket Operations - .NET Parallel Programming - Site Home - MSDN Blogs
Awaiting Socket Operations - .NET Parallel Programming - Site Home - MSDN Blogs:
public static class SocketExtensions
{
public static SocketAwaitable ReceiveAsync(this Socket socket,
SocketAwaitable awaitable)
{
awaitable.Reset();
if (!socket.ReceiveAsync(awaitable.m_eventArgs))
awaitable.m_wasCompleted = true;
return awaitable;
}public static SocketAwaitable SendAsync(this Socket socket,
SocketAwaitable awaitable)
{
awaitable.Reset();
if (!socket.SendAsync(awaitable.m_eventArgs))
awaitable.m_wasCompleted = true;
return awaitable;
}// ...
}
How to uninstall NuGet (to allow a reinstall of NuGet)
Known Issues: "Cannot uninstall NuGet"
TIP: If the "manage NuGet packages" is missing from Visual Studio 2012, try uninstalling this Vsix extension and then relaunching VS2012.
TIP: If the "manage NuGet packages" is missing from Visual Studio 2012, try uninstalling this Vsix extension and then relaunching VS2012.
In order to uninstall NuGet, run the following command.vsixinstaller.exe /uninstall:NuPackToolsVsix.Microsoft.67e54e40-0ae3-42c5-a949-fddf5739e7a5
Wednesday, May 29, 2013
Create/rename a file/folder that begins with a dot in Windows? - Super User
Create/rename a file/folder that begins with a dot in Windows? - Super User:
To create/rename on windows explorer, just rename to
.name.
- The additional dot at the end is necessary, and will be removed by Windows Explorer.To create a new file begins with a dot, on command prompt:
echo testing > .name
C#: Real world examples
I recommend buying the book: Real-World Functional Programming: With Examples in F# and C#
Friday, May 17, 2013
Of Filesystems And Other Demons: What's New in Win8 for File System Filters
Of Filesystems And Other Demons: What's New in Win8 for File System Filters:
"One thing that's been missing from FltMgr since the beginning and the developers have complained about was the ability to filter other devices that have file system semantics, and in particular named pipes (NPFS). It looks like in Win8 that's finally going to happen and we'll finally be able to write minifilters for NPFS. Moreover, it looks like the folks in Redmond went the extra mile and have added support for the Mailslot file system (MSFS) as well:C:\Windows\system32>fltmc volumes Dos Name Volume Name FileSystem Status ------------------------------ --------------------------------------- ---------- -------- \Device\Mup Remote C: \Device\HarddiskVolume2 NTFS \Device\HarddiskVolume1 NTFS \Device\NamedPipe NamedPipe \Device\Mailslot Mailslot D: \Device\CdRom0 UDFS Detached \Device\HarddiskVolumeShadowCopy1 NTFS D: \Device\CdRom0 UDFSThere is even an in-box filter attached to NPFS:C:\Far>fltmc filters
Saturday, May 11, 2013
Pushing the Limits of Windows: Virtual Memory - Mark's Blog - Site Home - TechNet Blogs
Pushing the Limits of Windows: Virtual Memory - Mark's Blog - Site Home - TechNet Blogs:
'via Blog this'
'via Blog this'
A couple of final limits related to virtual memory are the maximum size and number of paging files supported by Windows. 32-bit Windows has a maximum paging file size of 16TB (4GB if you for some reason run in non-PAE mode) and 64-bit Windows can having paging files that are up to 16TB in size on x64 and 32TB on IA64. Windows 8 ARM’s maximum paging file size is is 4GB. For all versions, Windows supports up to 16 paging files, where each must be on a separate volume.
Version Limit on x86 w/o PAE Limit on x86 w/PAE Limit on ARM Limit on x64 Limit on IA64 Windows 7 4 GB 16 TB 16 TB Windows 8 16 TB 4 GB 16 TB Windows Server 2008 R2 16 TB 32 TB Windows Server 2012 16 TB
Subscribe to:
Posts (Atom)