Ray Dillinger scripsit: > This would involve rules about what (shared) variables are "in scope" > in particular threads, with other threads not permitted to use them, > right? Or with particular threads having "write" access and other > threads having "read" access to the same variable?
Unfortunately, shared variables aren't the half of it. Shared mutable data structure is a much worse problem, because the compiler can't catch it. If I pass the same list (in the sense of eq?) to two threads, and each of them calls reverse! on it with the classical constant-space algorithm, my program will become "free and wild and beyond good and evil, with laws and morals thrown aside" (HPL, "The Call of Cthulhu"), and (more to the point) unlikely to do the right thing. > It's a very good model for, eg, dataflow programming. In dataflow, > you have many parts of the computation connected by queues of data.[1] Yes, I absolutely agree that that's the Right Thing. But the essence of such queues is that mutable data in them must be *copied*, as in the case of Unix pipes, not shared. -- John Cowan [email protected] http://ccil.org/~cowan If a traveler were informed that such a man [as Lord John Russell] was leader of the House of Commons, he may well begin to comprehend how the Egyptians worshiped an insect. --Benjamin Disraeli _______________________________________________ r6rs-discuss mailing list [email protected] http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss
