|
From: Konstantin S. <kon...@gm...> - 2009-03-05 13:12:27
|
2009/3/5 Tayfun Elmas <tay...@gm...>: > Let me briefly restate the question. The algorithm we are implementing has > special rules to handle pthread_xxx functions. We would like to be notified > when a pthread_xxx function is called but would like NOT to be notified > whatever happens within these functions. You can disable notifications while in ptread_xxx Like this: http://code.google.com/p/data-race-test/source/browse/trunk/tsan/ts_valgrind_intercepts.c#427 > As a result, we want the sample > code Pinar sent to trigger our algorithm when pthread_create and > pthread_join are called but not any other time. I think there is some > mechanism in Valgrind to do this, but we could not understand it clearly. > Thanks. > > Tayfun > - Show quoted text - > > Konstantin Serebryany wrote: >> >> On Tue, Mar 3, 2009 at 3:29 PM, Pınar Tözün <pin...@gm...> wrote: >> >>> >>> Hi, >>> >>> I am trying to implement the dynamic race detection algorithm >>> "Goldilocks" into Helgrind but I am having some difficulties with the >>> source code. The below c code is from the Valgrind Manual, >>> >>> #include <pthread.h> >>> >>> int var = 0; >>> >>> void* child_fn ( void* arg ) { >>> var++; /* Unprotected relative to parent */ /* this is line 6 */ >>> return NULL; >>> } >>> >>> int main ( void ) { >>> pthread_t child; >>> pthread_create(&child, NULL, child_fn, NULL); >>> var++; /* Unprotected relative to child */ /* this is line 13 */ >>> pthread_join(child, NULL); >>> return 0; >>> } >>> >>> My question is; how can I understand when hg_handle_client_request is >>> called and entered one of the LOCK cases, that it is not for the >>> Helgrind's own locking procedures but it is for one of the locks in >>> the checked c code. Because for the above example c code, although >>> there is no locking for the variable 'var' it calls a lot of >>> hg_handle_client_request with one of the LOCK cases in the switch >>> statement. >>> >> >> Not sure I understood your problem. >> Do you see LOCK/UNLOCK events when executing the program above? >> There is probably some locking inside pthread_create... >> >> --kcc >> >> >>> >>> Thank you! >>> pinar >>> >>> >>> ------------------------------------------------------------------------------ >>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >>> CA >>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>> Enterprise >>> -Strategies to boost innovation and cut costs with open source >>> participation >>> -Receive a $600 discount off the registration fee with the source code: >>> SFAD >>> http://p.sf.net/sfu/XcvMzF8H >>> _______________________________________________ >>> Valgrind-developers mailing list >>> Val...@li... >>> https://lists.sourceforge.net/lists/listinfo/valgrind-developers >>> >>> >> >> > > |