1. A method, comprising: associating a portion of a shared memory with a reference counting data structure comprising an owner field and an array of two or more atomically addressable entries, wherein each of the entries comprises a per-thread reference counter and a per-thread counter lock, and wherein at most a single thread can own the reference counting data structure at any given time; assigning one or more of a plurality of threads to respective entries of the array, wherein each of the one or more of the plurality of threads is assigned to a different entry in the array such that at most a single thread is assigned to any given one of the entries, and wherein the per-thread reference counter of each entry indicates a current number of references to the portion of the shared memory by the thread assigned to the entry; one of the plurality of threads determining whether the current number of references to the portion of the shared memory is zero or non-zero, wherein said determining comprises: the one of the plurality of threads writing a particular value in the owner field to acquire ownership of the reference tracking data structure; and the one of the plurality of threads examining one or more of the entries of the array; and the one of the plurality of threads returning a value indicating whether the current number of references to the portion of the shared memory is zero or is non-zero.