Is anyone aware of what operations are involved when a call to pthread_self() is made, obtaining the unique thread ID on a Ubuntu system (or even any Linux flavour)?
Specifically, to retrieve the thread id, is there any locking required or atomic operations?
I'm building an... (11 Replies)
I have the following code snippet's. Which one among these would be more expensive ?
for (int fd = 0; fd <= 1024; ++fd)
for (int fd = 0; fd <= 1024; fd += 8)
close(fd+2);... (6 Replies)