[Eug-lug] Concurrency, (free lunch is over article)

Bob Miller kbob at jogger-egg.com
Fri Jan 7 13:49:37 PST 2005


larry price wrote:

> On a practical level, I'd like to ask the list regarding your
> experiences with multi-processing machines and the hardware and
> software issues that go with them.

Yes, I have experienced those. (-:

> I've also had to deal with concurrency issues in a network context,
> and would be interested in hearing about tools to analyse concurrent
> processes
> (tools including software, but mostly the math and logic tools that
> give an insight into what is happening and why and reason about
> systems coherently)

Partly you need a coherent design (always a good idea (-: ).
Understand what the intended state transitions are. There's a UML
diagram for showing how processes respond to each other's messages,
sorry I'm too lazy to look up its name.

I've used many multiprocess debuggers, and none of them seemed to work
very well.  I generally rely on log files.  If you have a coherent
design (see above), you can log each input, each output, and each
state transition from each thread, then filter those to see the
interesting stuff.  With a little planning in your log message
formats, you can make grep very useful.  Yes, grep.  How archaic is
that?

Note that syslog doesn't preserve strict ordering. (Actually,
there is no strict ordering.)

The other importand thing is to minimize design complexity.  If you
can adopt a common pattern like a monitor, producers/consumers, or
remote procedure call, it's easier to get it right.

Another useful discipline is to strictly order resource types.  I.e.,
always lock A before locking B.  In a complex system, there might be
hundreds of types of locks.  By strictly ordering them, you can use
runtime assertions that locks are never acquired out of order.  In
fact, you can generate the ordering at runtime too.  But runtime
checking requires stress testing.

I think better tools are coming.

-- 
Bob Miller                              K<bob>
kbobsoft software consulting
http://kbobsoft.com                     kbob at jogger-egg.com


More information about the EUGLUG mailing list