Print

Print


@abh3 - poking through the disassembled code, it does appear the compiler (gcc on EL6) does a respectable job - the AtomicAdd becomes simply:

```
add    %rax,0x28(%rbx)
```

(Looking at XrdLink::Recv(char*, int) -- well, ignoring the mutex spinning and whatnot)

Because the function definition is in the header, it gets inlined everywhere and the optimizers take out the trash (this is at the default of -O2).  At the assembler level, the template-based approach seems equivalent.  Obviously, I cannot attest for anything on Solaris - but it's really not a complex optimization for the compiler to figure out.

---
Reply to this email directly or view it on GitHub:
https://github.com/xrootd/xrootd/pull/22#issuecomment-52181943

########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the XROOTD-DEV list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=XROOTD-DEV&A=1