From: David P G. <gr...@us...> - 2002-08-30 20:39:25
|
Adding a VM_Magic.CAS is probably the wrong approach. Adding VM_Synchronization.compareAndSwap (implemented using prepare/atrempt) would be better, but code using it would probably have some slight performance hit on PowerPC. I'd hope that JMMtk would avoid using VM_Magic. prepare/attempt almost entirely in favor of higher level synchronization operations already provided (or to be added) in VM_Synchronization et al. I believe prepare and attempt are portable if they are used correctly. But, the semantics are subtle so as much as possible VM code should use higher level synchronization primitives instead of using prepare/attempt directly. In the current system, there are only 10 source files that use VM_Magic.prepare directly (and only 4 files in the memory management subsystem). --dave |---------+--------------------------------------------------------> | | Chapman Flack <fl...@ce...> | | | Sent by: jikesrvm-researchers-admin@www-124. | | | southbury.usf.ibm.com | | | | | | | | | 08/30/2002 12:52 PM | | | Please respond to jikesrvm-researchers | | | | |---------+--------------------------------------------------------> >------------------------------------------------------------------------------------------| | | | To: jik...@ww... | | cc: | | Subject: Re: [Jikesrvm-researchers] prepare and attempt | | | | | >------------------------------------------------------------------------------------------| SJF> I think you're probably right that a CAS primitive would be easier to > understand than the current prepare/attempt primitives. However, the CAS > primitive might hurt PowerPC performance a little compared to the current > scheme. hmm ... would it make sense to retain prepare/attempt for use in existing and powerpc-specific parts of the code base, and also provide CAS as a primitive for use in new code intended to be portable (I'm thinking, for instance, of JMTk)? Chapman Flack fl...@cs... _______________________________________________ Jikesrvm-researchers mailing list Jik...@ww... http://www-124.ibm.com/developerworks/oss/mailman/listinfo/jikesrvm- researchers |