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/
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Access Request, Session and Application in Struts2If we want to use request, Session and application in JSP, what should we do? We can obtain Map type objects such as Req...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.