if i have a file descriptor duplicated (both point to the same resource), is that thread safe to perform close of each respective fd in different threads?
yes
There is a refcount used to release a resource at the last close, but is that access thread safe?
yes