awise_micron Posted February 5, 2016 Report Share Posted February 5, 2016 When the PoC simulator is built to use pthreads (which, while not the default, is useful since it allows valgrind to work properly on Linux) then some models, that spawn many threads, cause a simulation when run for a long time to run out of resources with the error: "ERROR - could not create thread" This is because threads are created as joinable threads, but nothing is joining the threads once they've completed, so their resources are not recovered. If the threads are created detached then everything seems to work as expected, because the threads' resources are immediately released as they exit. The following one-line addition in sc_cor_pthread.cpp at line 196 sets the detached state, and resolves the problem: pthread_attr_setdetachstate( &attr, PTHREAD_CREATE_DETACHED ); (See the attached patchfile.) systemc-2.3.1.patchfile.txt maehne 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.