C# 클래스 Shielded.VersionList

This class handles everything about assigning version stamps to readers and writers, and takes care of determining what is the minimum used stamp, so that old unreachable versions can be released to the GC.
파일 보기 프로젝트 열기: jbakic/Shielded 1 사용 예제들

공개 메소드들

메소드 설명
GetReaderTicket ( ReadTicket &ticket ) : void

Reader should keep a reference to his ticket, and release it with a call to ReleaseReaderTicket when done.

GetUntrackedReadStamp ( ) : ReadTicket

For commute running block, because it knows that the ticket taken by the main transaction is all the protection it needs.

NewVersion ( WriteStamp stamp, WriteTicket &ticket ) : void

Called after a thread checked and can commit. This will assign it a unique stamp to use for writing. This method will enter the new stamp into the stamp.Version. It must be done here to guarantee that no GetReaderTicket will return your stamp number before it has been written into your stamp lock! After completing your write, place your changes into the ticket, and this class will trim the old versions at the correct time. It is critical that this be done, which is why this method returns it as an out param - to make sure no exception can cause us to lose the ref to the ticket, if it is already in the chain.

ReleaseReaderTicket ( ReadTicket &ticket ) : void

After no reading will be done for the given reader ticket, release it with this method.

TrimCopies ( ) : void

비공개 메소드들

메소드 설명
VersionList ( ) : System

메소드 상세

GetReaderTicket() 공개 정적인 메소드

Reader should keep a reference to his ticket, and release it with a call to ReleaseReaderTicket when done.
public static GetReaderTicket ( ReadTicket &ticket ) : void
ticket ReadTicket
리턴 void

GetUntrackedReadStamp() 공개 정적인 메소드

For commute running block, because it knows that the ticket taken by the main transaction is all the protection it needs.
public static GetUntrackedReadStamp ( ) : ReadTicket
리턴 ReadTicket

NewVersion() 공개 정적인 메소드

Called after a thread checked and can commit. This will assign it a unique stamp to use for writing. This method will enter the new stamp into the stamp.Version. It must be done here to guarantee that no GetReaderTicket will return your stamp number before it has been written into your stamp lock! After completing your write, place your changes into the ticket, and this class will trim the old versions at the correct time. It is critical that this be done, which is why this method returns it as an out param - to make sure no exception can cause us to lose the ref to the ticket, if it is already in the chain.
public static NewVersion ( WriteStamp stamp, WriteTicket &ticket ) : void
stamp WriteStamp
ticket WriteTicket
리턴 void

ReleaseReaderTicket() 공개 정적인 메소드

After no reading will be done for the given reader ticket, release it with this method.
public static ReleaseReaderTicket ( ReadTicket &ticket ) : void
ticket ReadTicket
리턴 void

TrimCopies() 공개 정적인 메소드

public static TrimCopies ( ) : void
리턴 void