Re: [Masf-restricted-dev] CR/CN: Fixed thread-safety issues in HXScheduler
"Petar Basic" <[email protected]>
| Newsgroups | gmane.comp.multimedia.helix.devel |
|---|---|
| Message-ID | <[email protected]> |
Commited to: HEAD hxclient_3_4_0_atlas hxclient_3_1_0_atlas Petar On Sat, Sep 6, 2008 at 6:47 AM, Milko Boic <[email protected]> wrote: > > Excellent find and fix!!! > > Please commit to the following additional branches as well: > hxclient_3_1_0_atlas > HEAD > > Thanks, > Milko > > At 06:14 PM 9/5/2008, Petar Basic wrote: > > Modified by: pbasic at real.com > Date: 2008/09/06 > Project: strummer > > Synopsis: > Fixed thread-safety issues in HXScheduler > > Details: > There was a race condition in ClientPQ class. > ClientPQ is derived from PQ which accepts CHXID object as an argument > to the constructor. ClientPQ is obviously designed as a thread-safe > wrapper around PQ, but each instance of ClientPQ uses its own mutex > object. However, this is not enough. Since CHXID object can be > shared among PQ instances, it must be protected by a single mutex. > Instantiations of ClientPQ in HXScheduler are critical to this case > since HXScheduler uses 3 ClientPQ objects which share a single CHXID. > HXOptimizedScheduler currently uses only 1 ClientPQ object. > > 1.) Additional assert statements which can detect race condition have > been added to CHXID class. > 2.) ClientPQ is modified to accept externally created mutex. In this > way CHXID object can be protected through common mutex by multiple > ClientPQ instances. > 3.) Destruction of PQ base in ClientPQ destructor has been made thread-safe. > 4.) HXScheduler has been modified to use a single mutex with all of > its ClientPQ instances. > 5.) Although it was not necessary at this time, HXOptimizedScheduler > has been modified in the same way as HXScheduler to prepare it for > possible future updates. > > Testing: > Performed over 1200 transcoding transfers to USB memory during single > VFMM session without crashes or lockups. Also performed simultaneous > transfers to 2 USB devices without crashes or lockups. > > Files Modified: > common/util/pub/id.h > common/system/pub/pq.h > common/system/pq.cpp > client/common/system/pub/clientpq.h > client/common/system/clientpq.cpp > client/common/system/pub/hxsched.h > client/common/system/hxsched.cpp > client/common/system/pub/hxoptsc.h > client/common/system/hxoptsc.cpp > > Platforms and Profiles Build Verified: > system id: win32-i386-vc7 > profile: helix-dtdr-all-defines > > Platforms and Profiles Functionality Verified: > x86 Windows XP SP2 > > Branch: > hxclient_3_4_0_atlas > > Copyright assignment: > I am a RealNetworks employee or contractor. > > Content-Type: application/octet-stream; name="common_util.diff" > X-Attachment-Id: f_fkrjl7q00 > Content-Disposition: attachment; filename=common_util.diff > > Content-Type: application/octet-stream; name="common_system.diff" > X-Attachment-Id: f_fkrjlb201 > Content-Disposition: attachment; filename=common_system.diff > > Content-Type: application/octet-stream; name="client_common_system.diff" > X-Attachment-Id: f_fkrjld282 > Content-Disposition: attachment; filename=client_common_system.diff > > _______________________________________________ > Masf-restricted-dev mailing list > [email protected] > http://lists.helixcommunity.org/mailman/listinfo/masf-restricted-dev > _______________________________________________ Helix-client-dev mailing list [email protected] http://lists.helixcommunity.org/mailman/listinfo/helix-client-dev