joyent/node — pull request #8090 by bnoordhuis (2014-08-06 16:07:28+00:00)
Title: src: expose libuv handle/req id on process object

Assign numeric identifiers to libuv handle and request wrappers and
expose them to JS land as process._uvContextId[0]. Provides an ersatz
"thread-local" state for tracking execution across asynchronous calls.

Future optimization: reuse identifiers so they keep fitting in a SMI?

R=@trevnorris?

This PR is a conversation starter. The goal is to have a cheap way of tracking the flow of execution across callbacks for instrumentation purposes.