std:: string 의 두 가지 실현 방식

1801 단어 String
두 가지 가 있 습 니 다.
1. COW(copy on wirte):
현재 주류 의 실현 이지 만 다 중 스 레 드 환경 에서 성능 문제 가 있 을 수 있다.
참고:
How is std::string implemented?
http://stackoverflow.com/questions/1466073/how-is-stdstring-implemented
 
Copy - On - Write 의 원리 및 구체 적 실현
http://news.ccidnet.com/art/32855/20100719/2120339_1.html
쓰기 에 복사 (쓰기 시 복사)
http://www.programlife.net/copy-on-write.html
2.Short string optimization
cow 노출 문 제 를 해결 하기 위해 또 다른 실현 방안 이 나 타 났 습 니 다. llvm 서브 프로젝트 인 '새로운 libc + 0x' 는 이러한 실현 을 사용 합 니 다.
 
From years of experience (including having implemented the standard library before), we've learned many things about implementing the standard containers which require ABI breakage and fundamental changes to how they are implemented. For example, it is generally accepted that building std::string using the "short string optimization" instead of using Copy On Write (COW) is a superior approach for multicore machines (particularly in C++'0x, which has rvalue references). Breaking ABI compatibility with old versions of the library was determined to be critical to achieving the performance goals of libc++.
 
레 퍼 런 스
libc + + 0x 프로젝트
http://libcxx.llvm.org/

좋은 웹페이지 즐겨찾기