Method and system for managing and sharing data using smart pointers
AssigneeBeijing Baidu Netcome Science Technology Co. Ltd.
InventorYingze Bao
Life of this patent
Estimating the term…
Abstract
A computer-implemented method and system for managing and sharing data using smart pointers. The computer-implemented method includes obtaining original data and storing the original data in memory. Further, the computer-implemented method includes creating a smart pointer for the original data in a first thread. Furthermore, the computer-implemented method includes duplicating the smart pointer from the first thread to a second thread. Moreover, the computer-implemented method includes share the original data across the first thread and the second thread.
Claims16
A computer-implemented method for managing and sharing data using smart pointers, the computer-implemented method comprises:
- obtaining original data and storing the original data in a memory in a multi-threaded device localization and environment reconstruction system including a pose estimation thread, a 3D reconstruction thread, a bundle adjustment thread and a relocalization thread;
- creating a smart pointer for the original data in a first thread, wherein the smart pointer comprises a memory address of the original data and an integer counter, the created smart pointer pointing to the memory address and the integer counter indicating a number of the smart pointer;
- duplicating the smart pointer from the first thread to a second thread, wherein the first thread and the second thread are different threads included in the multi-threaded device localization and environment reconstruction system, the duplicated smart pointer comprising the memory address of the original data and the integer counter, the created and duplicated smart pointers pointing to the memory address of the original data and integer counters included in the smart pointers indicating numbers of the smart pointers, and creating a look-up table by the second thread, wherein the look-up table comprises a plurality of smart pointers amongst multiple threads;
- sharing the original data in the memory across the first thread and the second thread via the memory address of the original data;
- deleting the smart pointer within the first thread in response to the first thread deleting a part of the original data;
- and
- releasing the memory by a destructor of the created and duplicated smart pointers, when the created and duplicated smart pointers are deleted.
A non-transitory computer-readable medium storing a computer program that, when executed by a processor, causes the processor to perform a method for managing and sharing data using smart pointers, wherein the method comprises:
- obtaining original data and storing the original data in a memory in a multi-threaded device localization and environment reconstruction system, wherein the first thread and the second thread are different threads included in the multi-threaded device localization and environment reconstruction system;
- creating a smart pointer for the original data in a first thread, wherein the smart pointer comprises a memory address of the original data and an integer counter, the created smart pointer pointing to the memory address and the integer counter indicating a number of the smart pointer;
- duplicating the smart pointer from the first thread to a second thread, wherein the first thread and the second thread are different threads included in the multi-threaded device localization and environment reconstruction system, the duplicated smart pointer comprising the memory address of the original data and the integer counter, the created and duplicated smart pointers pointing to the memory address of the original data and integer counters included in the smart pointers indicating numbers of the smart pointers and creating a look-up table by the second thread, wherein the look-up table comprises a plurality of smart pointers amongst multiple threads;
- sharing the original data in the memory across the first thread and the second thread via the memory address of the original data;
- deleting the smart pointer within the first thread in response to the first thread deleting a part of the original data;
- and
- releasing the memory by a destructor of the created and duplicated smart pointers, when the created and duplicated smart pointers are deleted.
A system for data management and sharing using smart pointers, the system comprising:
- a memory;
- a computing device in a multi-threaded device localization and environment reconstruction system including a pose estimation thread, a 3D reconstruction thread, a bundle adjustment thread and a relocalization thread;
- and
- a processor configured within the computing device and operable to:
- obtain original data and storing the original data in the memory;
- create a smart pointer for the original data in a first thread, wherein the smart pointer comprises a memory address of the original data and an integer counter, the created smart pointer pointing to the memory address and the integer counter indicating a number of the smart pointer;
- duplicate the smart pointer from the first thread to a second thread, wherein the first thread and the second thread are different threads included in the multi-threaded device localization and environment reconstruction system, the duplicated smart pointer comprising the memory address of the original data and the integer counter, the created and duplicated smart pointers pointing to the memory address of the original data and integer counters included in the smart pointers indicating numbers of the smart pointers and creating a look-up table by the second thread, wherein the look-up table comprises a plurality of smart pointers amongst multiple threads;
- share the original data in the memory across the first thread and the second thread via the memory address of the original data;
- and
- release the memory by a destructor of the created and duplicated smart pointers, when the created and duplicated smart pointers are deleted.
Dependencies are inferred from the claim text.