|
From: | Ken Raeburn |
Subject: | Re: Some introductory docs about C level threading |
Date: | Tue, 8 Feb 2005 16:45:08 -0500 |
On Feb 6, 2005, at 19:48, Kevin Ryde wrote:
Ken Raeburn <address@hidden> writes:The problem is, if there are any case where it would be needed, then weneed to use it everywhere there could be a potential problem. Depending on just how it works out, that could mean essentially declaring some of the scheme object types (like cons cells) as volatile, which would be poor for performance.I'd think it shouldn't hurt too much. A store written in the code probably means a store should be done :-). Optimizations for local variables etc should be unchanged, just memory ops become exactly as written.
And a read becomes a read, with no option for combining multiple reads from the location. I think that's where the performance might not be so good.
And volatile declarations may fix the possibility of storing incompletevalues, but I don't think it would deal with the cross-thread memory access ordering issue.I think we have to assume all threads see memory ops in the order they're done (anything else is too crazy), and with that assumption and some care libguile ought to be ok.
Then you will never have a correct port to the Alpha, at least. The Alpha architecture specification allows for rearrangement of accesses except when a memory barrier instruction is used. (Memory operations issued before the MB must precede those issued after it.) I'd be very surprised if other modern architectures didn't also use various weak memory models, for performance in multiprocessor configurations.
[Prev in Thread] | Current Thread | [Next in Thread] |