Object subclass: #Task instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: nil ! Task comment: 'I am a virutal process' ! !Task class methodsFor: 'instance creation'! new | r | r := super new. r init. ^r ! ! !Task methodsFor: 'instance initialization'! init ! ! !Task methodsFor: 'instance destruction'! terminate Simulator memory removePid: self pid. ! ! !Task methodsFor: 'memory access'! pageNum: anAddr ^Page by: (self pid) at: (anAddr // (Simulator args pagesize)). ! read: anAddr Simulator memory read: (self pageNum: anAddr). ! write: anAddr Simulator memory write: (self pageNum: anAddr). ! ! !Task methodsFor: 'pid lookup'! pid ^Simulator tasks keyAtValue: self ifAbsent: [ ^self error: 'Danger, Penguins on fire' ]. ! !