Skip to content
Advertisement

rdtsc accuracy across CPU cores

I am sending network packets from one thread and receiving replies on a 2nd thread that runs on a different CPU core. My process measures the time between send & receive of each packet (similar to ping). I am using rdtsc for getting high-resolution, low-overhead timing, which is needed by my implementation. All measurments looks reliable. Still, I am worried

Get the name of the directory where a script is executed

I have some script, that uses files in directories around it. It uses command. It should work from any directory where I run this script, but when I run a symbolic link that points to that script I get the path of symbolic link. So I get the output of dirname rather than the path of the script itself. Any

appname: /lib/libc.so.6: version `GLIBC_2.8′ not found (required by appname)

ldd -v appname appname is compiled on Ubuntu 9.10, trying to run compiled product on Centos 5. My guess is that Centos5’s /lib/libc.so.5 provides up to version GLIBC_2.4, but appname calls for GLIBC_2.8. But here’s the funny thing. This problem didn’t happen until I started linking to boost’s system library. Before it was just boost’s thread library, but now I

Compile/run assembler in Linux?

I’m fairly new to Linux (Ubuntu 10.04) and a total novice to assembler. I was following some tutorials and I couldn’t find anything specific to Linux. So, my question is, what is a good package to compile/run assembler and what are the command line commands to compile/run for that package? Answer The GNU assembler (gas) and NASM are both good

How I can get ports associated to the application that opened them?

I need to get a list of all opened ports on my machine and what application opened them. I need to get this information programmatically. Thanks. Answer I was hoping a cleverer answer would appear. I did just this (programmatically in Python), in an attempt to rewrite a program called NetHogs. My version is here, specifically here is the module

BASH: how to perform arithmetic on numbers in a pipe

I am getting a stream of numbers in a pipe, and would like to perform some operations before passing them on to the next section, but I’m a little lost about how I would go about it without breaking the pipe. for example Would you have any ideas on how to make something like this work? The actual operation I

getting HTML source or rich text from the X clipboard

How can rich text or HTML source code be obtained from the X clipboard? For example, if you copy some text from a web browser and paste it into kompozer, it pastes as HTML, with links etc. preserved. However, xclip -o for the same selection just outputs plain text, reformatted in a way similar to that of elinks -dump. I’d

Advertisement