-
Oct 30, 2013
New Project
Was just told I’m going to be working on one of the newer systems. I get to use Git and a bunch of modern development tools. And I’ll be using C# instead of C++. I’m v happy about all this. Hello garbage collection.
-
Sep 26, 2013
82
Today at work we had a workshop about the processes some of the new projects are using. They’re definitely interesting, and we all played around with the workflow on the development server. Code is written, unit tested, and pushed to a remote Git repository all from within Qt Creator, where the code automatically has unit tests and Valgrind memory analysis performed. GitLab is hosted on our software server, which integrates nicely with continuous integration. I’d like to use some of that stuff…
-
Sep 24, 2013
Post Vaycay
Took two weeks off to go to Europe. I think I forgot how to program…
-
Jul 16, 2013
My .cshrc
Aside from a bunch of environment variable settings and shortcuts to oft-used directories, I’m collecting in my .cshrc file some little aliases.
Here are a handful of my favorites:
# so meta alias cshrc 'vi ~/.cshrc' # note-taking is v important alias notes 'vi ~/documents/notes.txt' # this one just makes me think I never do typos alias sl ls # display directory contents after cd-ing (stolen from Wikipedia) alias cd 'cd \!* && ls' # yes I'm this lazy alias status 'svn status' # so v lazy alias update 'svn update' # makefiles woooo alias build 'make clean ; make all' # only show warnings/errors alias buildquiet 'make clean > /dev/null ; make all > /dev/null' # always show line numbers w/ grep results alias grep 'grep -n' # teleport to a server (esp cool w/ PKA) alias servername 'ssh -X username@servername' # resets the terminal. god i love a clean terminal window alias r 'tput reset' # new terminal window alias term 'gnome-terminal &' # shut down the computer alias goodnight 'sudo /sbin/shutdown -h -P -time "now"'
-
Jul 10, 2013
Running in Real-Time
In C/C++, you can make a process run on a specified CPU and set its priority.
#include <sched.h></code> // set CPU affinity so we can only run on CPU 7 cpu_set_t mask; CPU_ZERO(&mask); CPU_SET(7, &mask); sched_setaffinity(0, sizeof(mask), &mask); // 0 here means set the affinity of this PID // set real-time process priority and first-in, first-out policy struct sched_param params; params.sched_priority = 50; // higher number = higher priority sched_setscheduler(0, SCHED_FIFO, ¶ms);
I did more testing on the code I wrote yesterday, and found that running my utility with an entire real-time system was impacting my performance. I used the code above to make my utility run on a dedicated CPU and with real-time priority. This resulted in good performance–I found that messages were being sent late only about .5% of the time–which is acceptable for this application since the requirements specify approximately a rate of 114 Hz.
Read more about sched_setaffinity and sched_setscheduler.