Path: utzoo!attcan!uunet!cme-durer!libes From: libes@cme-durer.ARPA (Don Libes) Newsgroups: comp.lang.c Subject: implementing Dijkstra's guarded commands Keywords: in a serial environment, parallel to come Message-ID: <515@muffin.cme-durer.ARPA> Date: 14 Jul 88 03:38:26 GMT Organization: National Bureau of Standards, Gaithersburg, MD Lines: 29 I am rendering an algorithm into C that was originally written using Dijkstra's guarded commands. I am wondering if there is a nice way of writing the C so that the algorithm preserves the possibility for parallel execution - should such a processor appear on my desk in the near future. Indeed, I've been specifically told that there is a high likelihood that the code will be moved to a parallel environment. Which one, however, is unknown at this time. By "possibility", I mean "with minimal code rewriting". For example, a simplistic way is to ignore the potential for parallel execution and just fixedly serialize the statements. But this is obviously not in the spirit of what I am asking. I am prepared to accept that this is entirely out of the realm of C. After all, it seems as though many people are barely able to come to terms with the idea of a compiler rearranging operands in an expression. Now, I'm asking about rearranging statements in a subroutine. Yes, I realize this is a very difficult problem. For example, parallel execution of guards containing functions with side-effects would be awful. (Fortunately, I don't believe I have to worry about that particular problem.) Anyway, I have never heard of any such conventions. Even if they are just personal (i.e., used only by yourself), I would be interested in hearing about them. Pointers to literature gratefully accepted, also. Don Libes cme-durer.arpa ...!uunet!cme-durer!libes