<feed xmlns='http://www.w3.org/2005/Atom'>
<title>squashfs-tools-ng.git/lib/sqfs/data_writer, branch v0.8</title>
<subtitle>A new set of tools and libraries for working with SquashFS images</subtitle>
<id>https://git.infraroot.at/squashfs-tools-ng.git/atom?h=v0.8</id>
<link rel='self' href='https://git.infraroot.at/squashfs-tools-ng.git/atom?h=v0.8'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/'/>
<updated>2019-12-13T01:27:17+00:00</updated>
<entry>
<title>Merge windows and pthread thread pool implementations</title>
<updated>2019-12-13T01:27:17+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-13T01:27:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=2d2772341fa65e3d412e76c6e9d4a8815756c0ec'/>
<id>urn:sha1:2d2772341fa65e3d412e76c6e9d4a8815756c0ec</id>
<content type='text'>
Since they are both structured the same way using condition variables,
they are only a few defines away from removing code duplication.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup data writer</title>
<updated>2019-12-13T01:05:42+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-13T01:00:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=514e9e500abdd8ea91ea3b2fca214587ee24a342'/>
<id>urn:sha1:514e9e500abdd8ea91ea3b2fca214587ee24a342</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Don't kick off the threads until the queue is full</title>
<updated>2019-12-12T15:43:01+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-12T13:23:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=f274c6a208bb329298f83f05d0f9fe8e1a8b5423'/>
<id>urn:sha1:f274c6a208bb329298f83f05d0f9fe8e1a8b5423</id>
<content type='text'>
The idea is as follows: Initially let the user submit blocks until the
queue is filled, then kick of the threads. Every thread will end up
getting a block without any waits until they completely deplete the
queue. Assuming the threads take longer to process the data than it
takes the main thread to do I/O and submit new blocks, the queue should
stay mostly filled with minimal wait times.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix thread pool queue accounting</title>
<updated>2019-12-12T11:48:33+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-12T11:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=6d4faedcb53f54253160f1717fac609f922ae0c7'/>
<id>urn:sha1:6d4faedcb53f54253160f1717fac609f922ae0c7</id>
<content type='text'>
 - ONLY manipulate the back log counter in the main thread.
 - Fix the order of operations when submitting blocks.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Replace SetEvent synchronization with condition variables</title>
<updated>2019-12-08T15:48:59+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-08T15:47:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=6d7db2bd7ce39621f27f9f669690ab606ddc1787'/>
<id>urn:sha1:6d7db2bd7ce39621f27f9f669690ab606ddc1787</id>
<content type='text'>
It's cleaner, more stable and works pretty much the same way as the
pthread version. The downside is that the minimum target for the
library is now Windows Vista, or Server 2008. But both are over a
decade old anyway, so this shouldn't be an issue.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add native Windows port of the multi-threaded data writer</title>
<updated>2019-12-08T13:17:53+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-08T13:17:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=d98411f53939b7e308f186e5b61791677f3b0ad9'/>
<id>urn:sha1:d98411f53939b7e308f186e5b61791677f3b0ad9</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Minor data writer cleanup</title>
<updated>2019-12-05T14:44:50+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-05T14:44:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=9ea91c044106537453ae6e13368b60ce532c885c'/>
<id>urn:sha1:9ea91c044106537453ae6e13368b60ce532c885c</id>
<content type='text'>
Move "do block" function over to the rest of the block related
code and internalizie the pthread worker structure.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Fix pthread data writer interfering with signal handling</title>
<updated>2019-12-05T11:32:00+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-12-05T11:15:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e17da4c1150b1f8be9071c7403163ea6fb518c6e'/>
<id>urn:sha1:e17da4c1150b1f8be9071c7403163ea6fb518c6e</id>
<content type='text'>
If a signal is sent to a process, the POSIX spec says that ANY thread
could be picked ARBITRARILY to handle the signal. In our case this could
be one of the internal worker threads.

The problem here is that an unsuspecting user of the library might
suddenly have their signal handler run in parallel to their main thread
and run into weird concurrency issues, because they didn't expect that
to happen.

In fact, the libsquashfs API tries to be transparent about whether or
not it uses a thread pool internally and does everything other than
number crunching (e.g. I/O that may happen through user supplied
callbacks) in the same thread as the one that submitts the blocks.

Unfortunately, pthread doesn't have a way to set a signal mask for the
new thread and setting it inside the thread is racy (i.e. a signal might
be delivered before the worker thread sets the mask).

The only portable and non-racy way to do this, is to disable all signals
in the calling thread that sets up the data writer, create the threads
(which will inherit the mask) and then resetore the previous signal mask,
hoping for the best.

The downside to this is that signals may be lost in that short time.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move overflow safe alloc code into libsquashfs</title>
<updated>2019-11-25T12:20:08+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-11-25T12:13:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=fc9a644002dc501a5c224e5cc1a7dfba3ca2d1d8'/>
<id>urn:sha1:fc9a644002dc501a5c224e5cc1a7dfba3ca2d1d8</id>
<content type='text'>
There were only a hand full of instances outside libsquashfs that used
the alloc code. In most cases, the thing allocated hat its size derived
from something already in memory anyway, so it is safe to assume its
size fits into a size_t.

At the same time, the opencoded Windows path conversion functions are
all unified into a single helper function.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move libutil related headers to "util" sub directory</title>
<updated>2019-10-07T13:34:22+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2019-10-07T13:26:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=c973bcc1039b64ec00acaf8e8d61b9f5229da56f'/>
<id>urn:sha1:c973bcc1039b64ec00acaf8e8d61b9f5229da56f</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
