MùPùF.org

Linux, Programming and Octopodes

--- *Projects* (website in development: svn r299)--- » PPassKeeper » ArduIDE

Steve Dodier-Lazaro's blog Steve Dodier-Lazaro's blog subscribe

Programming

Showing articles in category: (See all)

Programming

Parallel programming: Hello World with Intel TBBParallel programming: Hello World with Intel TBB

in Programming
Tags: developmentparalleltbbtechnologytutorial

To many people out there, parallel programming may not sound very useful, and actually pretty complicated. However, everybody expects processors to have several cores and software to make use of them. The whole purpose of parallel programming is to leverage the capabilities of multi-core processors, but this comes with a cost: we need to rethink our way of programming, moving from the old single-threaded or "a thread per task" programs to applications that describe their work-flow in tasks that can be concurrently processed: what is called task-based programming.

This may sound difficult, but it is necessary to produce code that can actually use several cores, and also scale properly (ie. keep a decent performance level) from single-core processors to computer grids with hundreds of cores. The problem of multi-thread apps made by hand is that often, threads are planned per task, but even worse, the number of logical threads in the program is not equal to the number of physical threads on the CPU, but to the number of tasks, which is fixed. This means the program does not scale at all, unless thread pools are created and managed by hand, which means a huge code overhead for the thread pool management system. Besides, this means you still have to do load balancing between threads on your own, which is again a difficult task.

To the difference of multi-threaded apps with synchronisation code, the goal here is to leave all thread management and task assignment to a specifically built library. In this article, I am going to explain the very basics of Intel Threading Building Blocks, most likely one of the most efficient and simple multi-core programming libraries in the wild.

Published Nov. 13, 2011 by read more
0

How-to: Use Graphviz to draw graphs in a Qt graphics sceneHow-to: Use Graphviz to draw graphs in a Qt graphics scene

in Programming
Tags: developmentgraphqtresearchtutorial

Well, it's been a long time. This post will be dedicated to explanations on how to draw graphs in Qt's QGraphicsScene, using GraphViz. We're not talking about rendering an SVG graph with GraphViz and then printing it in a scene, however. What we will do, instead, is:

  • represent a graph, using a C++ wrapper class for libgraph
  • tell GraphViz to compute positions for each node, and the path of each edge
  • draw our graph using QGraphicsEllipseItem and QGraphicsPathItem

The whole thing is used in a computer security research project on which I'm not allowed to give any information, so I will be vague on some parts of this tutorial, and I will not provide a whole bunch of ready-to-run code. I'm still going to give you the hints for fulfilling the three tasks above, and I will publish the class I wrote for my project (it is, of course, not generic at all, since it was designed for my particular needs).

This tutorial assumes you have a decent knowledge of how Graphviz works, and basic knowledge of the QGraphics API.

Published July 8, 2010 by read more
6

Things I learned while writing SynemaThings I learned while writing Synema

in Programming
Tags: developmentlinuxresearchsecurity

As I pointed out in previous blog entries, I've been running short on time in the last few months. The reason is that I put quite a lot of time into a project that was assigned to me as part of my studies. The goal of the project was to create an application allowing graphical monitoring of various system and network security tools, such as SELinux, PIGA (currently under development in my school, ENSI of Bourges), Osiris, Snort, etc.

Published Feb. 21, 2010 by read more
5