Why was GlobalWire called GlobalWire?

Date:November 8, 2005 / year-entry #340
Tags:history
Orig Link:https://blogs.msdn.microsoft.com/oldnewthing/20051108-05/?p=33423
Comments:    10
Summary:John Elliott wondered why the GlobalWire function was called GlobalWire. First, some background for those who never had to write 16-bit Windows programs. The GlobalWire function was similar to the 16-bit GlobalLock function, except that it had the bonus feature of relocating the memory to the lowest available linear address. You used this function as...

John Elliott wondered why the GlobalWire function was called GlobalWire.

First, some background for those who never had to write 16-bit Windows programs. The GlobalWire function was similar to the 16-bit GlobalLock function, except that it had the bonus feature of relocating the memory to the lowest available linear address. You used this function as a courtesy if you intended to leave the memory locked for a long time. Moving it to the edge of the address space means that it is unlikely to become an obstacle in the middle of the address space which would otherwise prevent future large memory allocations from succeeding.

But why "wire"?

This employs a colloquial sense of the word "wire" as a verb which has lost its currency in the intervening years. To wire means to fasten securely in a very strong sense. It probably derives from the phrase "hard-wired", which means "permanently attached in circuitry". Therefore, "wiring" memory into place ensures that it doesn't move around.


Comments (10)
  1. Gabe says:

    I believe that in modern VM parlance this would be called "pinning". One "pins" memory to prevent it from being paged out or GC’d.

  2. bramster says:

    "But why "wire"?"

    In applications where a nut-and-bolt fastening system must not vibrate loose, the nut used is a "castlelated" nut, the bolt has a hole through it. After tightening the nut, a "safety-wire" is run through the hole, and twisted into place. There are special "safety-wire" pliers, which make the twisting of the wire very quick.

  3. Scott says:

    Thoughts of old core memory leap to mind…

  4. K.T. says:

    "GlobalWire"??? – Sounds more like a financial transaction!

    Is this a prime example of why APIs should be vetted for colloquialisms?

    Are there any win32 functions that have esoteric names?

  5. John Elliott says:

    Wow. That was almost same-year service :-)

    Gabe: I don’t think this is quite the same as pinning, because that would be done with GlobalLock. Or maybe GlobalFix. Oddly enough, there isn’t a GlobalPin or GlobalGlue or GlobalWeld…

  6. Art says:

    I like PrestoChangoSelector() more.

  7. Daev says:

    A function with the same intent as GlobalWire might still be useful.

    Suppose your program is used for number crunching on potentially very large matrices. You might need to grab several BIG chunks of memory from the allocator.

    If you could ensure that your program’s modules (application, DLLs, etc.) hugged the fringes of virtual memory address space, that would leave lots of free empty room in the middle.

    Wide open stretches of contiguous unallocated memory could mean the difference between success and failure when you call malloc(REALLY_BIG_NUMBER).

  8. Mike Dunn says:

    Daev> The system DLLs are already mapped at the top end of the lower 2GB of the address space. As for your own allocs, VirtualAlloc() lets you specify the virtual address in the address space, so if you know you’re going to have large allocs, you can do them in the middle of the 2GB range.

    Or, you can use the techniques that Raymond posted about a while ago (in the series about misconceptions regarding memory and address space) if you need to manually swap data in/out of your address space.

  9. James Risto says:

    GlobalWire and PrestoChangoSelector are still more meaningful than the BurgerMaster segment!

  10. mschaef says:

    "GlobalWire and PrestoChangoSelector are still more meaningful than the BurgerMaster segment! "

    Not if you’re hungry after working long hours on the memory manager. :-)

Comments are closed.


*DISCLAIMER: I DO NOT OWN THIS CONTENT. If you are the owner and would like it removed, please contact me. The content herein is an archived reproduction of entries from Raymond Chen's "Old New Thing" Blog (most recent link is here). It may have slight formatting modifications for consistency and to improve readability.

WHY DID I DUPLICATE THIS CONTENT HERE? Let me first say this site has never had anything to sell and has never shown ads of any kind. I have nothing monetarily to gain by duplicating content here. Because I had made my own local copy of this content throughout the years, for ease of using tools like grep, I decided to put it online after I discovered some of the original content previously and publicly available, had disappeared approximately early to mid 2019. At the same time, I present the content in an easily accessible theme-agnostic way.

The information provided by Raymond's blog is, for all practical purposes, more authoritative on Windows Development than Microsoft's own MSDN documentation and should be considered supplemental reading to that documentation. The wealth of missing details provided by this blog that Microsoft could not or did not document about Windows over the years is vital enough, many would agree an online "backup" of these details is a necessary endeavor. Specifics include:

<-- Back to Old New Thing Archive Index