-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The Library is not able to release the locks - ARM platform #23
Comments
Hi,
|
Hello, I solved the issue, there is a bug in the library and major code issue : Let me explain the issue first, I created my code which links to the GAPP library as dynamic linked library. and my code was launched using Fork(), unfortunately code was hanging as Semaphores were not getting released. After careful debugging found the issue struct execution_context Thread_pool.cpp, this creates the instance of thread_pool when library is loaded ( when parent process is loaded ) but was getting used by child process where semaphore were locked this was changed to /* struct execution_context
Thus ensuring that the code only executes when object is created, if you find this useful please add to main branch.
|
Please read my first comment, especially points 2 and 4. You can't just fork a multithreaded process, there is no issue with the library in this respect. See also: |
Hello,
I am building this library for ARM with GCC11.4 but found that if I launch my code as process using fork ( linux ) which call GAPP the code hangs and unable to proceed but if launched as boost::thread it works !!!!
if (auto* local_queue = local_worker_queue(); !local_queue)
{
remaining_tasks.wait();
}
else while (true)
{
while (!local_queue->empty()) { std::invoke(*local_queue->take()); }
if (remaining_tasks.try_wait()) break;
std::this_thread::yield();
}
The code gets stuck in While true loop in thread_pool.hpp. Please suggest !!! It works nicely in Intel
I even tried looking into architecture specific code : This also doesn't work
define GAPP_PAUSE() asm volatile("yield" ::: "memory") in utility.hpp
I am stuck for 2 weeks, any hit would be helpful
The text was updated successfully, but these errors were encountered: