<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Parallel compression version 1.21 ... in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-compression-version-1-21/m-p/836457#M1610</link>
    <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have updated my parallel compression library to version 1.21 ,&lt;/P&gt;&lt;P&gt;in the GzipCompress() i have done something like this:&lt;/P&gt;&lt;P&gt;-------------------------------&lt;BR /&gt;1 - if count_compress = Tjob(obj).index&lt;BR /&gt;2- then &lt;BR /&gt;3- begin&lt;BR /&gt;4- &lt;BR /&gt;5- bzip.compressStream(Tjob(obj).stream,local_stream);&lt;BR /&gt;6- local_stream.position:=0;&lt;BR /&gt;7- Tjob(obj).fstream.CopyFrom(local_stream,local_stream.size);&lt;BR /&gt;8- count_compress:=count_compress+1;&lt;BR /&gt;9- local_count:=count_compress;&lt;BR /&gt;10- break;&lt;BR /&gt;11- end;&lt;BR /&gt;12- until false ;&lt;BR /&gt;------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But there is a race condition , since between line 8 and 9 a &lt;BR /&gt;thread may modify count_compress and you can get a corrupt &lt;BR /&gt;information in line 9.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have corrected it with something like this:&lt;/P&gt;&lt;P&gt;-------------------------------&lt;BR /&gt;if count_compress = Tjob(obj).index&lt;BR /&gt;then &lt;BR /&gt; begin&lt;BR /&gt; &lt;BR /&gt; bzip.compressStream(Tjob(obj).stream,local_stream);&lt;BR /&gt; local_stream.position:=0;&lt;BR /&gt; Tjob(obj).fstream.CopyFrom(local_stream,local_stream.size);&lt;BR /&gt; local_count:=count_compress+1;&lt;BR /&gt; count_compress:=local_count;&lt;BR /&gt; break;&lt;BR /&gt; end;&lt;BR /&gt;until false ;&lt;BR /&gt;------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you can download the new updated version from:&lt;/P&gt;&lt;P&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;Amine Moulay Ramdane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2010 01:59:48 GMT</pubDate>
    <dc:creator>aminer10</dc:creator>
    <dc:date>2010-04-21T01:59:48Z</dc:date>
    <item>
      <title>Parallel compression version 1.21 ...</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-compression-version-1-21/m-p/836457#M1610</link>
      <description>&lt;P&gt;&lt;BR /&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have updated my parallel compression library to version 1.21 ,&lt;/P&gt;&lt;P&gt;in the GzipCompress() i have done something like this:&lt;/P&gt;&lt;P&gt;-------------------------------&lt;BR /&gt;1 - if count_compress = Tjob(obj).index&lt;BR /&gt;2- then &lt;BR /&gt;3- begin&lt;BR /&gt;4- &lt;BR /&gt;5- bzip.compressStream(Tjob(obj).stream,local_stream);&lt;BR /&gt;6- local_stream.position:=0;&lt;BR /&gt;7- Tjob(obj).fstream.CopyFrom(local_stream,local_stream.size);&lt;BR /&gt;8- count_compress:=count_compress+1;&lt;BR /&gt;9- local_count:=count_compress;&lt;BR /&gt;10- break;&lt;BR /&gt;11- end;&lt;BR /&gt;12- until false ;&lt;BR /&gt;------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;But there is a race condition , since between line 8 and 9 a &lt;BR /&gt;thread may modify count_compress and you can get a corrupt &lt;BR /&gt;information in line 9.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have corrected it with something like this:&lt;/P&gt;&lt;P&gt;-------------------------------&lt;BR /&gt;if count_compress = Tjob(obj).index&lt;BR /&gt;then &lt;BR /&gt; begin&lt;BR /&gt; &lt;BR /&gt; bzip.compressStream(Tjob(obj).stream,local_stream);&lt;BR /&gt; local_stream.position:=0;&lt;BR /&gt; Tjob(obj).fstream.CopyFrom(local_stream,local_stream.size);&lt;BR /&gt; local_count:=count_compress+1;&lt;BR /&gt; count_compress:=local_count;&lt;BR /&gt; break;&lt;BR /&gt; end;&lt;BR /&gt;until false ;&lt;BR /&gt;------------------------------------------------&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And you can download the new updated version from:&lt;/P&gt;&lt;P&gt;&lt;A href="http://pages.videotron.com/aminer/"&gt;http://pages.videotron.com/aminer/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Sincerely,&lt;BR /&gt;Amine Moulay Ramdane.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2010 01:59:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Parallel-compression-version-1-21/m-p/836457#M1610</guid>
      <dc:creator>aminer10</dc:creator>
      <dc:date>2010-04-21T01:59:48Z</dc:date>
    </item>
  </channel>
</rss>

