Thank you for this review and comments! I have started a small home project and am using restbed for it. I faced the same problems as you, you answered many of my questions.
Windows or Linux? On Linux there was an issue with case sensitivity of the filenames. Make sure you have the latest version of the code from github and are running CMake with the vcpkg toolchain options as described in "Using vcpkg with CMake": vcpkg.io/en/getting-started.html
Your code look like it have data race, only using `mutex` on modifying operations is not enough as concurrent request could access same data without lock. Probably better solution would have `std::atomic` and each request simply get "snapshot" of whole database on begging.
You're right that reads have to be blocked while the data structure is being modified, but all reads could take place concurrently. Concurrency is hard :)
getting the bellow error: -- The C compiler identification is GNU 11.2.0 -- The CXX compiler identification is GNU 11.2.0 -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working C compiler: /usr/bin/cc - skipped -- Detecting C compile features -- Detecting C compile features - done -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done CMake Error at CMakeLists.txt:5 (find_package): By not providing "Findrestbed.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "restbed", but CMake did not find one. Could not find a package configuration file provided by "restbed" with any of the following names: restbedConfig.cmake restbed-config.cmake Add the installation prefix of "restbed" to CMAKE_PREFIX_PATH or set "restbed_DIR" to a directory containing one of the above files. If "restbed" provides a separate development package or SDK, be sure it has been installed.
@@UtahCppProgrammers Hello. Im having the same problem. I cloned the git repo and executed the following commands: - mkdir build - cd build/ - vcpkg integrate install - vcpkg install - cmake .. "-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake" (i got the error here) Any suggestions?
@@eltonvivot1545 Try renaming cmake/FindRestbed.cmake to cmake/Findrestbed.cmake. Windows file system is by default case insensitive. I'll update my repo.
Source code: github.com/LegalizeAdulthood/comicsdb-restbed
Thank you for this review and comments!
I have started a small home project and am using restbed for it. I faced the same problems as you, you answered many of my questions.
I'm glad you found it useful!
Is there a recipe example available for restbed that can be used for Yocto projects?
Are you referring to the embedded linux distro? www.yoctoproject.org/
It's just linux, so normal linux development practices would apply.
That was an amazing session! Is there a link to the source code of the comicsdb project?
I added a pinned comment with the link.
@UtahCppProgrammers I use VsCode and when I have thie error Could NOT find restbed (missing: RESTBED_LIB RESTBED_INCLUDE)
Windows or Linux? On Linux there was an issue with case sensitivity of the filenames. Make sure you have the latest version of the code from github and are running CMake with the vcpkg toolchain options as described in "Using vcpkg with CMake": vcpkg.io/en/getting-started.html
Your code look like it have data race, only using `mutex` on modifying operations is not enough as concurrent request could access same data without lock. Probably better solution would have `std::atomic` and each request simply get "snapshot" of whole database on begging.
You're right that reads have to be blocked while the data structure is being modified, but all reads could take place concurrently. Concurrency is hard :)
getting the bellow error:
-- The C compiler identification is GNU 11.2.0
-- The CXX compiler identification is GNU 11.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Error at CMakeLists.txt:5 (find_package):
By not providing "Findrestbed.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "restbed", but
CMake did not find one.
Could not find a package configuration file provided by "restbed" with any
of the following names:
restbedConfig.cmake
restbed-config.cmake
Add the installation prefix of "restbed" to CMAKE_PREFIX_PATH or set
"restbed_DIR" to a directory containing one of the above files. If
"restbed" provides a separate development package or SDK, be sure it has
been installed.
Are you getting this error from my project on github or on your own?
@@UtahCppProgrammers Hello. Im having the same problem. I cloned the git repo and executed the following commands:
- mkdir build
- cd build/
- vcpkg integrate install
- vcpkg install
- cmake .. "-DCMAKE_TOOLCHAIN_FILE=/opt/vcpkg/scripts/buildsystems/vcpkg.cmake" (i got the error here)
Any suggestions?
@@eltonvivot1545 Try renaming cmake/FindRestbed.cmake to cmake/Findrestbed.cmake. Windows file system is by default case insensitive. I'll update my repo.