Useful Sticky Notes

Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, October 31, 2014

Quick Updates - Development Focus

I apologize for the lack of any new posts over the past few months. I'd been suffering from some health issues that limited my ability to focus on technical matters. It has gotten better now, and I am trying to do some catching up.

It has recently occurred to me that my background of working with HPC tools and codes over a wide range of HPC software stacks and platforms, had left me with a development experience that is ad-hoc and poorly structured. This realization was coupled with the understanding that I now only possess the Mac OS X development environment as the only real convenient platform to work with. I can also do some work on my Windows machine via minGW, but it is really set up as my gaming platform. Finally, I do have Ubuntu on Virtualbox on my MacBook Pro on which to do Linux development, but that is fairly inconvenient. My living environment is also limiting any idea that I pick up a dedicated Linux box as an alternative. Finally, I realized that Mac OS X Darwin is not merely a Linux/Unix variant, but has its own set of internal design choices and implementation that make any naive approach to tool development from a Linux-centered perspective unproductive.

As such, I plan on taking a step back after the long hiatus to properly acquaint myself with Mac OS X internals from the perspective of a tool developer. Over the next few months, I will attempt to document my experiences and what I have learned as I try to implement common HPC tools design idioms. These idioms will include basics like attaching/coupling tool runtimes with user code/binaries at varying degrees of transparency. They will also include library wrapping and override idioms. These idioms will perhaps for the basis for my next article, to give readers a sense of where I am coming from with regards to my own software development background involving tools.

Monday, June 18, 2012

Linux Signalling Pains

Attempts to make sense of it all for the general collection of samples from Timer Interrupts.

Edit 6/19/2012: Given the many issues that need to be addressed, I've decided it would be clunky to attempt to complete them here. I will cover each individual topic piece-meal in subsequent posts.

This article will be work-in-progress for now. There are many things that I have explored (and conveniently forgotten), many things I have yet to explore and many more things that need to be fitted together to make any coherent sense of the matter. Portability issues play a big role in this.

Useful information sources:
Signal(7) - linux.die.net/man/7/signal
Thread Local Storage - www.akkadia.org/drepper/tls.pdf
Signal Re-entrancy - http://www.delorie.com/gnu/docs/glibc/libc_493.html

At the top level, THREE things will need to be addressed for our purposes:
  1. The establishment of timer-interrupts. I currently know of two ways of doing this: through the setitimer call (sys/time.h); or through the timer_create call (signal.h, time.h, link with -lrt).
  2. The handling of signals and signal masks. Choices of signals for this purpose are SIGPROF or SIGALRM. Masks need to be handled as necessary through sigprocmask. Edit 6/19/2012: sigprocmask is probably not sufficient for our needs. The alternative is signal(SIGPROF, SIG_IGN). I believe the trouble with the latter is that it applies to the entire process, so very careful handling with respect to threads is required.
  3. Working with threads. Considerations have to be made for threads like the use of pthread_sigmask and the not-so-portable use of thread local storage like __thread tls.
 That is it for now. Will attempt to get a more complete picture later.