>> I guess I am not following this ( as I am very new to helgrind and
valgrind ) . I am using ACE based Queues and Tasks (
http://www.cs.wustl.edu/~schmidt/ACE-overview.html<http://www.cs.wustl.edu/%7Eschmidt/ACE-overview.html>
)
>> and ACE already has Queue protection locks for multithread implementation
( over pthred for Linux and Windows API based threads for windows OS) .
Helgrind does not support this out of the box.

>> Are you suggesting I need to change ACE Queue put and get calls ?
This will work, at least it works for me (I have message queue somewhat
similar to ACE Queue).

>> or do I need to change something in helgrind source code ?
Doing this (and not changing ACE) might be challenging, though probably not
impossible.

I hope valgrind developers will forgive me for jumping into this discussion
before them. They might have much simpler solution.  :)

--kcc



On Dec 18, 2007 1:08 AM, Sahni, Jitan <[EMAIL PROTECTED]> wrote:

>  I guess I am not following this ( as I am very new to helgrind and
> valgrind ) . I am using ACE based Queues and Tasks (
> http://www.cs.wustl.edu/~schmidt/ACE-overview.html<http://www.cs.wustl.edu/%7Eschmidt/ACE-overview.html>
> )
> and ACE already has Queue protection locks for multithread implementation
> ( over pthred for Linux and Windows API based threads for windows OS) .
>
> Are you suggesting I need to change ACE Queue put and get calls ? or do I
> need to change something in helgrind source code ?
> I read the helgrind documentation and I don't understand how helgrind will
> know when a message passed into the queue does or does NOT enter a race
> condition ?
> especially when all threads are created at start ...
>
> Thanks
> Jitan
>
>
>  ------------------------------
> *From:* Konstantin Serebryany [mailto:[EMAIL PROTECTED]
> *Sent:* Monday, December 17, 2007 4:19 PM
> *To:* Sahni, Jitan
> *Cc:* [EMAIL PROTECTED];
> valgrind-developers@lists.sourceforge.net
> *Subject:* Re: [Valgrind-users] helgrind false alters in ACE Tasks (
> Linux)
>
> I have the same issue with our own message queues.
> Helgrind does not support them out of the box but can be easily enhanced.
>
> I did it with the help of source code changes:
>
> void Put(T elem) { // put() method of your queue
>   sem_t *uniq_sem = new sem_t;
>   sem_init(uniq_sem);
>   sem_post(uniq_sem);
>   // now do the actual 'put' stuff, putting uniq_sem together with elem
> }
>
> T Get() { // get() method of your queue
>   // do the actual 'get' stuff; get uniq_sem from queue together with elem
>   sem_wait(uniq_sem);
>   sem_destroy(uniq_sem);
>   delete uniq_sem;
>   return elem;
> }
>
> The good thing is that you don't really need to create a real semaphore --
> just create a integer with unique value (I use atomic_increment of static
> var) and pass it to appropriate helgrind's user requests (see helgrind.hand 
> hg_intercepts.c).
>
> The bad thing is that it might be challenging to achieve the same effect
> without source code changes.
> It is not enough to intercept the call to Put/Get routines -- you need to
> put something into the queue (at least, I did not find another way).
>
>
> --kcc
>
>
>
> On Dec 17, 2007 10:23 PM, Sahni, Jitan <[EMAIL PROTECTED]>
> wrote:
>
> >
> >  does helgrind work properly on ACE Tasks and Message Queues ?  I am
> > getting some helgrind race alerts when using ACE Tasks and Message Queues.
> > Basically the parent and child thread are created at start of the program
> > and then parent passes buffer of data to child thru ACE Message Queue . the
> > waiting child picks the data , uses it and frees it . helgrind is alerting
> > me on race condition on this model . Does helgrind work correctly on this
> > model of multi threads ( tasks and Queues ) ?
> >
> > Also is there any way to print memory contents of the location printed
> > in a race condition ?
> >
> >
> >
> > ==============================================================================
> > Please access the attached hyperlink for an important electronic 
> > communications disclaimer:
> > http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> > ==============================================================================
> >
> >
> >
> > -------------------------------------------------------------------------
> > SF.Net email is sponsored by:
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services
> > for just about anything Open Source.
> >
> > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
> > _______________________________________________
> > Valgrind-users mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/valgrind-users
> >
> >
> ==============================================================================
> Please access the attached hyperlink for an important electronic 
> communications disclaimer:
> http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
> ==============================================================================
>
>
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Valgrind-developers mailing list
Valgrind-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-developers

Reply via email to