<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog of Tim Janik &#187; GLib</title>
	<atom:link href="http://blogs.gnome.org/timj/category/glib/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/timj</link>
	<description>Technical ramblings by Tim Janik</description>
	<lastBuildDate>Tue, 15 Sep 2009 07:59:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>23.06.2008 Writing Unit Tests with GLib</title>
		<link>http://blogs.gnome.org/timj/2008/06/24/23062008-writing-unit-tests-with-glib/</link>
		<comments>http://blogs.gnome.org/timj/2008/06/24/23062008-writing-unit-tests-with-glib/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 15:14:04 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>
		<category><![CDATA[Gtk+]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2008/06/24/23062008-writing-unit-tests-with-glib/</guid>
		<description><![CDATA[
 Every other week, someone asks how to use the new unit testing framework in GLib (released with GLib-2.16.0) and Gtk+ (to be released with the next stable). First, here is a write-up from last December that summarizes all important aspects:  Test Framework Mini Tutorial.
 
 For people building packages that use the new [...]]]></description>
			<content:encoded><![CDATA[<p><!--- paragraph break --></p>
<p align="left"> Every other week, someone asks how to use the new <a href="http://library.gnome.org/devel/glib/stable/glib-Testing.html">unit testing framework in GLib</a> (released with <a href="http://mail.gnome.org/archives/gtk-devel-list/2008-March/msg00022.html">GLib-2.16.0</a>) and <a href="http://www.gtk.org">Gtk+</a> (to be released with the next stable). First, here is a write-up from last December that summarizes all important aspects: <a href="http://mail.gnome.org/archives/gtk-devel-list/2007-December/msg00181.html"> Test Framework Mini Tutorial</a>.</p>
<p> <!--- paragraph break --></p>
<p align="left"> For people building packages that use the new framework, the following new Makefile rules will be of interest:</p>
<ul type="square">
<li> <strong><code>make test</code></strong><br />
Run all tests recursively from $(TEST_PROGS), abort on first error.</li>
<li> <strong><code>make test-report</code></strong><br />
Run all tests recursively, continue on errors and generate <code>test-report.xml</code>.</li>
<li> <strong><code>make perf-report</code></strong><br />
Run all tests recursively, enable performance tests (this usually takes significantly longer), continue on errors, generate <code>perf-report.xml</code>.</li>
<li> <strong><code>make full-report</code></strong><br />
Run all tests recursively, enable performance tests, enable slow (thorough) tests, continue on errors, generate <code><a href="http://people.imendio.com/timj/examples/gtk+-full-report.html"> full-report.xml</a></code>.</li>
<li> <strong><code>make check</code></strong><br />
Run make test in addition to automake checks.</li>
</ul>
<p><!--- paragraph break --></p>
<p align="left"> After GUADEC, we will be looking into getting build machines setup that&#8217;ll regularly build GLib, Gtk+ and friends, run the unit testing suites and provide reports online.</p>
<p> <!--- paragraph break --></p>
<p align="left"> For those pondering to write unit tests, but too lazy to look at the tutorial:</p>
<ul type="square">
<li> Implementing a test program is very easy, the only things needed are:
<pre>  // initialize test program
  gtk_test_init (&amp;argc, &amp;argv);
  // hook up your test functions
  g_test_add_func ("/Simple Test Case", simple_test_case);
  // run tests from the suite
  return g_test_run();</pre>
</li>
<li> In most cases, a test function can be as simple as:
<pre>  static void
  simple_test_case (void)
  {
    // a suitable test
    g_assert (g_bit_storage (1) == 1);
    // a test with verbose error message
    g_assert_cmpint (g_bit_storage (1), ==, 1);
  }</pre>
<p>Tests that abort, e.g. via <a href="http://library.gnome.org/devel/glib/unstable/glib-Testing.html#g-assert">g_assert()</a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Message-Logging.html#g-error">g_error()</a>, are registered as failing tests with the framework. Also, the <a href="http://library.gnome.org/devel/glib/unstable/gtester.html">gtester</a> utility used to implement the above Makefile rules will restart a test binary after a test function failed and continue to run remaining tests if <a href="http://library.gnome.org/devel/glib/stable/glib-Testing.html#g-test-add-func">g_test_add_func()</a> has been used multiple times.</li>
<li> Checks in tests can be written with if() and g_error() or exit(1), or simply by using variants of g_assert(). For unit tests in particular, an extended set of assertions has been added, the benefit of using these are the printouts of the involved values when an assertion doesn&#8217;t hold:
<pre>  g_assert_cmpstr   (stringa, cmpop, stringb);
  g_assert_cmpint   (int64a,  cmpop, int64b);
  g_assert_cmpuint  (uint64a, cmpop, uint64b);
  g_assert_cmphex   (uint64a, cmpop, uint64b);
  g_assert_cmpfloat (doublea, cmpop, doubleb);</pre>
<p>For instance:<br />
<strong><code>char *string = "foo"; g_assert_cmpstr (string, ==, "bar");</code></strong><br />
yields:<br />
<strong><code>ERROR: assertion failed (string == "bar"): ("foo" == "bar")</code></strong></li>
<li> The framework makes it easy to test program output in unit tests:
<pre>  static void
  test_program_output (void)
  {
    if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDOUT |
                             G_TEST_TRAP_SILENCE_STDERR))
      {
        g_print ("some stdout text: somagic17\n");
        g_printerr ("some stderr text: semagic43\n");
        exit (0);
      }
    g_test_trap_assert_passed();
    g_test_trap_assert_stdout ("*somagic17*");
    g_test_trap_assert_stderr ("*semagic43*");
  }</pre>
</li>
<li> And it is similarly easy to test and verify intentional program abortion:
<pre>  static void
  test_fork_fail (void)
  {
    if (g_test_trap_fork (0, G_TEST_TRAP_SILENCE_STDERR))
      {
        g_assert_not_reached();
      }
    g_test_trap_assert_failed();
    g_test_trap_assert_stderr ("*ERROR*test_fork_fail*not*reached*");
  }</pre>
</li>
<li> The above and more tests are showcased in GLib: <a href="http://svn.gnome.org/viewvc/glib/trunk/glib/tests/testing.c?revision=6955&amp;view=markup">glib/tests/testing.c</a>.</li>
</ul>
<p><!--- paragraph break --></p>
<p align="left"> There&#8217;s of course lots of room left to improve GLib and Gtk+ unit tests, and also to improve the current framework. For a speculative, non-comprehensive list, here are some ideas from the unit testing section of my personal TODO:</p>
<p> <!--- paragraph break --></p>
<ul type="square">
<li> Introduce 2D marker recognition for graphical unit testing of Gtk+ layouts (prototyped in <a href="http://rapicorn.org">Rapicorn</a>).</li>
<li> Provide functionality to determine image similarities to allow for pixel image based unit tests (port this from Rapicorn).</li>
<li> Implement state dumps to automate result specification and verification in unit tests. (This will allow us to avoid adding lots of abusable testing hooks to our API.)</li>
<li> Integrate performance statistics (like <a href="http://bugzilla.gnome.org/show_bug.cgi?id=354457">#354457</a>) and other related information into test reports.</li>
<li> Publically install a variant of the <a href="http://svn.gnome.org/viewvc/gtk%2B/trunk/Makefile.decl?view=markup">Makefile.decl</a> file used in Gtk+ to implement the test framework rules and <a href="http://en.wikipedia.org/wiki/Xvfb">Xvfb</a> swallowing of test programs. This is needed by other projects to run unit tests the way Gtk+ does.</li>
<li> Implement the unit test ideas that are outlined at the end of this email: <a href="http://mail.gnome.org/archives/gtk-devel-list/2006-October/msg00093.html">Gtk+ unit tests (brainstorming)</a>.</li>
</ul>
<p><!--- paragraph break --></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2008/06/24/23062008-writing-unit-tests-with-glib/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>16.05.2008 Becoming a Gtk+ maintainer</title>
		<link>http://blogs.gnome.org/timj/2008/05/16/16052008-becoming-a-gtk-maintainer/</link>
		<comments>http://blogs.gnome.org/timj/2008/05/16/16052008-becoming-a-gtk-maintainer/#comments</comments>
		<pubDate>Fri, 16 May 2008 11:50:19 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>
		<category><![CDATA[Gtk+]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2008/05/16/16052008-becoming-a-gtk-maintainer/</guid>
		<description><![CDATA[
 Amongst many other things during the  Gtk+ Hackfest 2008, it was brought to my attention that Gtk+ maintainership is sometimes perceived as some kind of  leet circle, hard to join for newcomers. I can&#8217;t really imagine how &#8220;hard&#8221; it is for newcomers to join Gtk+ maintenance these days. The learning curve probably [...]]]></description>
			<content:encoded><![CDATA[<p><!--- paragraph break --></p>
<p align="left"> Amongst many other things during the <a href="http://live.gnome.org/GTK%2B/Hackfest2008"> Gtk+ Hackfest 2008</a>, it was brought to my attention that Gtk+ maintainership is sometimes perceived as some kind of <a href="http://en.wikipedia.org/wiki/Leet"> leet</a> circle, hard to join for newcomers. I can&#8217;t really imagine how &#8220;<em>hard</em>&#8221; it is for newcomers to join Gtk+ maintenance these days. The learning curve probably is steeper now than it was in the last decade, but then, we do have documentation now and didn&#8217;t have any back then&#8230; ;-)</p>
<p> <!--- paragraph break --></p>
<p align="left"> In any case, I think that definitely none of the Gtk+/GLib core maintainers would want to bar someone else from contributions or helping out with maintenance tasks. So to aid that process, I&#8217;ve written down what I keep telling people who approach me about this in person. A lot of it might seem overly obvious to veterans, but for newcomers or contributors looking into extending their activities on the project I hope to provide helpful starting points.</p>
<p> <!--- paragraph break --></p>
<p align="left"> Much of Gtk+ is still maintained as a huge monolithic whole. That is, a very few people are taking care of a wide variety of components. I think ultimately we would all be much better off, if we had more people being responsible for individual components like particular widgets (e.g. <a href="http://library.gnome.org/devel/gtk/unstable/GtkNotebook.html"> GtkNotebook</a>) or widget families (e.g. <a href="http://library.gnome.org/devel/gtk/unstable/GtkBox.html">GtkBox</a>, <a href="http://library.gnome.org/devel/gtk/unstable/GtkHBox.html">GtkHBox</a>, <a href="http://library.gnome.org/devel/gtk/unstable/GtkVBox.html">GtkVBox</a>). So the following are steps and tasks useful for anyone wanting to get into Gtk+ component maintenance.</p>
<p> <!--- paragraph break --></p>
<p align="left"> First of all, we have the <a href="http://live.gnome.org/GtkTasks">GtkTasks wiki page</a>, a task list with various ways in which people can contribute to the Gtk+ project and start getting involved. In particular for the following positions, no one has signed up so far to volunteer on a regular basis:</p>
<p> <!--- paragraph break --></p>
<ul type="disc">
<li> <strong>Patch/Bug Monitoring &amp; Filing</strong> &#8211; collect bugs from mailing lists and IRC to make sure they are being filed.</li>
<li> <strong>FAQ Maintainer</strong> &#8211; this involves monitoring the mailing list(s), taking CC:-mails from other people on possible FAQ material and regularly updating the FAQ accordingly.</li>
<li> <strong>Build Monitoring</strong> &#8211; run and maintain Gtk+ tool-chain builds on various platforms.</li>
<li> <strong>Making Releases</strong> &#8211; we are looking for someone assisting in the release process and to take over release building during some periods in the future.</li>
<li> <strong>Implementing Test Programs</strong> &#8211; there&#8217;s much work needed in our unit test coverage, so we&#8217;re always looking for people willing to implement more unit tests.</li>
</ul>
<p><!--- paragraph break --></p>
<p align="left"> For general information about the maintenance situation, the <a href="http://mail.gnome.org/archives/gtk-devel-list/2006-December/msg00074.html">State of the Gtk+ Maintenance</a> write-up is still fairly valid. However many good things have been suggested by the community since, such as the GtkTasks page and the Hackfest. At the end, the write-up addresses how occasional contributors or developers at different experience levels can help out the project. For instance with activities such as: <em>Bug triage and verification</em>, <em>Review and clarify documentation</em>, <em>Revision hunting for regressions</em>, <em>Refactor code areas</em>, <em>Work on optimizations</em>, and the list goes on.</p>
<p> <!--- paragraph break --></p>
<p align="left"> If none of this sounds interesting to potential new maintainers, be warned that regular maintenance means having to put up with pretty much all of these at some point. ;-)<br />
However, probably the most straight forward way to take on maintenance for a particular code portion (usually a particular widget) is to start becoming familiar with it and work on improving it right away:</p>
<p><!--- paragraph break --></p>
<ul type="disc">
<li> <strong>Cleanup indentation</strong> &#8211; lots of contributions to Gtk+ in the past have weakened coding style in various areas. In general we use <a href="http://www.gnu.org/prep/standards/standards.html"> GNU coding style</a> plus a few extra rules similar to the <a href="http://developer.gimp.org/faq.html#id2467385"> Gimp coding style</a>.</li>
<li> <strong>Perform code cleanups</strong> &#8211; look for outstanding migrations/refactorings in the code or if the implementation could be simplified/streamlined in areas.</li>
<li> <strong>Check documentation and examples</strong> &#8211; contributing by improving the existing documentation, testing existing examples and providing new ones is a very straight forward way to learn about a new component. Also, documentation patches are usually easily and quickly approved.</li>
<li> <strong>Provide unit tests</strong> &#8211; writing new unit tests for existing component APIs is even better than providing documentation examples. You get immediate feedback and they should in general be easy to approve to go into upstream. Also, it is definitely an area where Gtk+ and GLib still need lots of work.</li>
<li> <strong>Review bug reports and patches</strong> &#8211; go through the <a href="http://bugzilla.gnome.org/browse.cgi?product=gtk+"> Gtk+ bug load</a> of a particular component, see what issues could be closed or need info. Find patches that could be applied or need work and provide/fix patches along the way. Also, feel free to provide review for existing patches where you feel confident to provide reasonable input. For existing maintainers, looking at other people&#8217;s review is one of the best ways to figure if another person is up to the task of taking over component maintenance.</li>
<li> <strong>Actively nag existing maintainers</strong> or people with SVN accounts for trivial patches (like Cody and Mathias who signed up for <a href="http://live.gnome.org/GtkTasks#P2">Patch testing &amp; committing</a>) to review, approve and apply your changes.</li>
<li> <strong>Participate in the project forums</strong> like <a href="http://mail.gnome.org/archives/gtk-devel-list/">gtk-devel-list</a> and #gtk+ (needed to nag people from the <a href="http://www.gtk.org/development.html#Team">core team</a> and other developers), and read and reply in other <a href="http://www.gtk.org/mailing-lists.html">related mailing lists</a>.</li>
</ul>
<p><!--- paragraph break --></p>
<p align="left"> The first few points actually mean working with the code by providing patches, and filing new bug reports with those patches attached. While this may at first increase our bug load, if someone shows sincere interest in taking over component maintenance, sticks to the coding style and provides useful patches, there&#8217;s nothing stopping us from granting new SVN accounts so contributors can commit their own patches after approval.</p>
<p> <!--- paragraph break --></p>
<p align="left"> Finally, the project is welcoming every new contributor. But be reminded that no approval is needed from anyone to start your work. In actuality, asking for it will most probably get you a reserved or negative answer, because improving the project is all about working on it, not making or requesting promises. So, everyone is invited to read through the task lists/descriptions and get their hands dirty immediately. A fair bit of self incentive is needed to take on maintenance of a component anyway, so you&#8217;ll have to get yourself motivated on your own there won&#8217;t be anyone else doing it for you.</p>
<p> <!--- paragraph break --></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2008/05/16/16052008-becoming-a-gtk-maintainer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>07.04.2008 On Moving Gtk+ to Git</title>
		<link>http://blogs.gnome.org/timj/2008/04/07/07042008-on-moving-gtk-to-git/</link>
		<comments>http://blogs.gnome.org/timj/2008/04/07/07042008-on-moving-gtk-to-git/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 22:20:46 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>
		<category><![CDATA[Gtk+]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2008/04/07/07042008-on-moving-gtk-to-git/</guid>
		<description><![CDATA[
 There have been several requests about hosting Gtk+ (and GLib) as a  Git repository recently and since that topic has come up more and more often, I meant to write about this for quite some time. 
 
 Let&#8217;s first take a look at the actual motivation for such a move. There are [...]]]></description>
			<content:encoded><![CDATA[<p><!--- paragraph break -->
<p align="left"> There have been several requests about hosting Gtk+ (and GLib) as a <a href="http://git.or.cz/"> Git</a> repository recently and since that topic has come up more and more often, I meant to write about this for quite some time. </p>
<p> <!--- paragraph break -->
<p align="left"> Let&#8217;s first take a look at the actual motivation for such a move. There are a good number of advantages we would get out of using Git as a source code repository for Gtk+ and GLib: </p>
<p> <!--- paragraph break -->
<ul type="disc">
<li> We can work offline with the Gtk+ history and source code. </li>
<li> We can work much faster on Gtk+ even when online with tools such as <a href="http://www.kernel.org/pub/software/scm/git/docs/git-log.html"> git-log</a> and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-blame.html"> git-blame</a>. </li>
<li> It will be much easier for people to branch off and do development on their own local branches for a while, exchange their code easily with pulling branches between private repositories, etc. I.e. get all the advantages of a truly distributed versioning system. </li>
<li> With Git it&#8217;s much easier to carry along <a href="http://bugzilla.gnome.org/show_bug.cgi?id=318807"> big Gtk+ changes</a> including history by using <a href="http://www.kernel.org/pub/software/scm/git/docs/git-cherry-pick.html"> cherry picking</a> and <a href="http://www.kernel.org/pub/software/scm/git/docs/git-rebase.html"> (interactive) rebasing</a>. </li>
<li> We can make proper <strong>public</strong> backups of the source code repositories. This ought to be possible already via <a href="http://svnbook.red-bean.com/en/1.4/svn.ref.svnsync.html"> svnsync</a>, but isn&#8217;t for <a href="http://svn.gnome.org/viewvc/"> svn.gnome.org</a> because we run an svn 1.3.x server instead of an svn 1.4.x server that is required by svnsync. (Yes, this issue has been raised with the sysadmins already.) </li>
</ul>
<p> <!--- paragraph break -->
<p align="left"> A quick poll on IRC has shown that all affected core maintainers are pretty much favoring Git over SVN as a source code repository for GLib/Gtk+. </p>
<p> <!--- paragraph break -->
<p align="left"> However, here are the points to be considered for not moving the repositories to Git (just yet): </p>
<p> <!--- paragraph break -->
<ul type="disc">
<li> Complexity; Git is often perceived to be harder to use than SVN, there are several attempts to mitigate this problem though: <a href="http://www.gnome.org/~newren/eg/"> Easy Git</a> <a href="http://developer.imendio.com/projects/giggle/"> Giggle</a> <a href="http://blogs.gnome.org/timj/2007/10/30/30102007-yummyyummysourcecontrol-version-09/"> yyhelp</a>. <br /> With some of the above, Git is as easy to use as SVN is, so Git complexity doesn&#8217;t need to be holding anyone off at this point. </li>
<li> Git may be stable and mature these days, but <a href="http://www.kernel.org/pub/software/scm/git/docs/git-svn.html"> git-svn</a> is not there yet. It is generally good enough to create local Git mirrors of SVN repositories and work from those to have most of the Git convenience on top of an SVN project. <br /> But git-svn has seen structural changes recently, quite some rewriting and bug fixing that indicate it&#8217;s still too much in flux for the one-and-only SVN->Git migration for projects at the scale of Gtk+. This is not meant as criticism on git-svn, fairly the opposite actually. It&#8217;s good to see such an important component be alive and vivid. All issues I&#8217;ve raised with the maintainer so far have been addressed, but it seems advisable to wait for some stabilization before trusting all the Gtk+ history to it. </li>
<li> <a href="http://git.or.cz/gitwiki/Gitweb"> Gitweb</a> interfaces already exist for GLib/Gtk+ mirrors, for example on testbit: <a href="http://git.testbit.eu"> Testbit Git Browser</a>. <br /> These can be used for cloning which is much faster than a full git-svn import. Alternatively, shallow git-svn imports can be created like this:
<pre>  git-svn clone -T trunk -b branches -t tags -r 19001 svn://svn.gnome.org/svn/gtk+
</pre>
<p> This will create a repository with a mere ~1000 revisions, including all changes since we branched for 2.12. We&#8217;re using such a shallow repository for faster cloning of our <a href="http://micke.hallendal.net/blog/gtk-30-enabling-incrementalism/"> GSEAL()</a> development at Imendio: <a href="http://git.imendio.com/?p=projects/gtk%2B.git"> view gtk+.git</a>. </li>
<li> In summer 2006, we&#8217;ve had the first test migration of all of GNOME CVS to SVN, in December 2006 we&#8217;ve had the final migration. During that period, the <a href="http://beast.gtk.org"> Beast</a> project stayed migrated to SVN to work out the quirks from the CVS->SVN migration before we migrate all other GNOME modules and have to fix up everyones converted modules. There were quite some issues that needed fixing after the initial test migration and in the end we had to <a href="http://mail.gnome.org/archives/beast/2007-January/msg00001.html"> rebuild the Beast development history from pieces</a>. Preventing the other GNOME modules from such hassle was the entire point in migrating Beast early on, so I&#8217;m not complaining. <br /> However, given the size and importance of GLib/Gtk+, the development history of those projects shouldn&#8217;t be put at a similar risk. That is, GLib/Gtk+ shouldn&#8217;t be pioneering our next source repository migration, let some other small project do this and work out the quirks first. </li>
<li> git-svn already provides a good part of the Git advantages to developers while Gtk+ stays hosted in SVN. Albeit due to mismatching hashes, syncing branches between distinct git-svn checkouts of different people is tedious. Setting up an &#8220;official&#8221; git-svn mirror on <a href="http://gtk.org"> git.gtk.org</a> could probably help here. Also, to ease integration, <a href="http://www.gnome.org/~jamesh/jhbuild.html"> jhbuild</a> could be extended to use git-svn instead of svn commandos to update SVN modules, if the current module has a .git/ subdirectory instead of a .svn/ subdirectory. </li>
</ul>
<p> <!--- paragraph break -->
<p align="left"> The bottom line is, there&#8217;s a good number of advantages that Git already can (or <em>could</em>) provide for our development even without migrating the repositories to Git right away. When exactly will be a good point for migrating GLib/Gtk+ and possibly other GNOME modules might not be an easy call, but right now is definitely too early. </p>
<p> <!--- paragraph break --></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2008/04/07/07042008-on-moving-gtk-to-git/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>05.02.2008 Thread-safe class initializers</title>
		<link>http://blogs.gnome.org/timj/2008/02/05/05022008-thread-safe-class-initializers/</link>
		<comments>http://blogs.gnome.org/timj/2008/02/05/05022008-thread-safe-class-initializers/#comments</comments>
		<pubDate>Tue, 05 Feb 2008 18:17:43 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2008/02/05/05022008-thread-safe-class-initializers/</guid>
		<description><![CDATA[
 I finally got around to fix a long-standing and tricky bug report: Bug 64764 - Class initialization isn't thread safe.  Thread safety problems in class initializers and _get_type() functions caused nasty problems in other components that depend on parallel type creation, in particular GStreamer (Dependency Graph for bug 64764). With both being fixed [...]]]></description>
			<content:encoded><![CDATA[<p><!--- paragraph break -->
<p align="left"> I finally got around to fix a long-standing and tricky bug report: <code><a href="http://bugzilla.gnome.org/show_bug.cgi?id=64764">Bug 64764 - Class initialization isn't thread safe</a></code>. <br /> Thread safety problems in class initializers and <a href="http://bugzilla.gnome.org/show_bug.cgi?id=65041">_get_type() functions</a> caused nasty problems in other components that depend on parallel type creation, in particular GStreamer (<a href="http://bugzilla.gnome.org/showdependencygraph.cgi?id=64764">Dependency Graph for bug 64764</a>). With both being fixed now, testing feedback about GType/GObject threading problems using GLib trunk is appreciated. </p>
<p> <!--- paragraph break --></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2008/02/05/05022008-thread-safe-class-initializers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>17.08.2007 What are ELF libraries good for anyway?</title>
		<link>http://blogs.gnome.org/timj/2007/08/17/17082007-what-are-elf-libraries-good-for-anyway/</link>
		<comments>http://blogs.gnome.org/timj/2007/08/17/17082007-what-are-elf-libraries-good-for-anyway/#comments</comments>
		<pubDate>Fri, 17 Aug 2007 20:11:22 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>
		<category><![CDATA[Gtk+]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2007/08/17/17082007-what-are-elf-libraries-good-for-anyway/</guid>
		<description><![CDATA[ Or: Who in the world is actually linking against GLib without Gtk+? 
 I&#8217;m currently in the process of building some general purpose infrastructure for Rapicorn and because a good portion of the C++ utilities used in Beast and Rapicorn are factored out into an extra library called Birnet. I&#8217;m running into similar complexity [...]]]></description>
			<content:encoded><![CDATA[<p> Or: Who in the world is actually linking against GLib without Gtk+? </p>
<p> I&#8217;m currently in the process of building some general purpose infrastructure for <a href="http://rapicorn.org">Rapicorn</a> and because a good portion of the C++ utilities used in <a href="http://beast.gtk.org">Beast</a> and Rapicorn are factored out into an extra library called <a href="http://beast.gtk.org/rdocu-birnet/">Birnet</a>. I&#8217;m running into similar complexity issues here that we encountered with <a href="http://svn.gnome.org/viewcvs/glib/trunk/glib-2.0.pc.in?view=markup">libglib</a> vs. <a href="http://svn.gnome.org/viewcvs/glib/trunk/gobject-2.0.pc.in?view=markup">libgobject</a> vs. <a href="http://svn.gnome.org/viewcvs/gtk%2B/trunk/gdk-2.0.pc.in?view=markup">libgdk</a> already. I.e. lower level modules cannot reference or use mechanisms provided at a higher level (for instance <a href="http://mail.gnome.org/archives/gtk-devel-list/2005-November/msg00093.html">deriving GHashTable from GObject</a>). This becomes even worse with C++ which lacks support for <a href="http://en.wikipedia.org/wiki/Partial_class">partial classes</a> (a class definition spanning multiple source files, like implementing gtk_widget_foo() outside of libgtk). </p>
<p> One remedy would be to actually merge libbirnet and librapicorn into a single project and let Beast depend on librapicorn. However, that&#8217;s essentially like we started out with GLib and Gtk+ in late 1996 when it got split out of the <a href="http://gimp.org">Gimp</a> package. In June 1998 we <a href="http://mail.gnome.org/archives/gtk-list/1998-February/msg00173.html">split off libglib into a separate package</a> for programs needing C utilities but not <a href="http://svn.gnome.org/viewcvs/gtk%2B/trunk/gtk+-2.0.pc.in?view=markup">libgtk</a>. So now, I&#8217;m reconsidering this separation after almost a decade. Reflecting on the move is probably not a bad idea before attempting the opposite with Rapicorn: </p>
<p> <em>How many programs are actually linking against libglib but not libgdk, and is there any real benefit from separation?</em> <br /> If your machine has libglib and a few spare minutes, you can use this command line to find out on your own: <code>
<pre>	find `echo $PATH | sed 's/:/ /g'` -type f -perm +111 | xargs ldd 2&gt;/dev/null |
	  awk '/&#92;&lt;libglib-2&#92;&gt;/{ lg+=1 } /&#92;&lt;libgobject&#92;&gt;/{ lo+=1 } /&#92;&lt;libgdk_pixbuf&#92;&gt;/{ lp+=1 }
               END { print "glib=" lg " gobject=" lo " gdk=" lp ;
                     print "glib-only:    " 100*(lg-lo)/lg "%";
                     print "gobject-only: " 100*(lo-lp)/lg "%";
                     print "gdk-lot:      " 100*lp/lg "%"; }'</pre>
<p></code> Here are results from a couple machines I had quick access to: <code>
<pre>	Site                       Gdk  GObject     GLib  #Apps
	gimp.org:                50.0%    12.5%    37.5%     16
	gtk.org:                 47.1%    17.6%    35.3%     17
	developer.gnome.org:     19.5%    53.7%    26.8%     41
	my server (sarge):       66.7%    14.1%    19.3%    192
	my laptop (etch):        72.7%    14.8%    12.4%    209
	my desktop (feisty):     72.2%    17.1%    10.7%    252
	64bit KDE desktop (sid): 53.0%    16.7%    30.2%    338</pre>
<p></code> That is, the servers have a quite limited set of GUI applications installed, but across a full fledged desktop the vast majority of applications is linked against libgdk anyway. I found Stefan Westerfelds Amd64 <a href="http://kde.org">KDE desktop</a> particularly interesting: It actually has the most applications linking against GLib, prolly because it has <a href="http://de.wikipedia.org/wiki/Mono-Projekt">Mono</a> and <a href="http://doc.trolltech.com/4.3/qtcore.html">libQtCore.so</a> installed which both link against GLib these days. Does anyone actually have a system with libglib installed but <strong>not</strong> libgdk? </p>
<p> Next, let&#8217;s take a look at the actual &#8220;savings&#8221;: <code>
<pre>	ls -l libglib-2.0.so.0.1200.4 libgmodule-2.0.so.0.1200.4 &#92;
              libgobject-2.0.so.0.1200.4 libgthread-2.0.so.0.1200.4
	-rw-r--r-- 1 root root 596608 2006-11-16 10:26 libglib-2.0.so.0.1200.4
	-rw-r--r-- 1 root root   9784 2006-11-16 10:26 libgmodule-2.0.so.0.1200.4
	-rw-r--r-- 1 root root 237156 2006-11-16 10:26 libgobject-2.0.so.0.1200.4
	-rw-r--r-- 1 root root  14028 2006-11-16 10:26 libgthread-2.0.so.0.1200.4
	=====================================
	                       857576 = 837KB

	ls -l libatk-1.0.so.0.1214.0 libcairo.so.2.9.2 libpango-1.0.so.0.1400.8 &#92;
	      libgtk-x11-2.0.so.0.800.20 libgdk_pixbuf-2.0.so.0.800.20 &#92;
              libgdk-x11-2.0.so.0.800.20
	-rw-r--r-- 1 root root  102504 2007-03-14 13:44 libatk-1.0.so.0.1214.0
	-rw-r--r-- 1 root root  395836 2006-10-20 07:44 libcairo.so.2.9.2
	-rw-r--r-- 1 root root  235464 2007-01-14 22:27 libpango-1.0.so.0.1400.8
	-rw-r--r-- 1 root root   88604 2007-03-04 22:21 libgdk_pixbuf-2.0.so.0.800.20
	-rw-r--r-- 1 root root  528580 2007-03-04 22:21 libgdk-x11-2.0.so.0.800.20
	-rw-r--r-- 1 root root 3043524 2007-03-04 22:21 libgtk-x11-2.0.so.0.800.20
	=======================================
	                       4394512 = 4292KB</pre>
<p></code> GtkGdkPangoAtkCairoGlib / GLib ratio: (4394512 + 857576) / 857576 = 6.12. <br /> So the &#8220;savings&#8221; turn out to be splitting off 5/6th of the GUI stack size. At best, a GLib-only program is saving 4.2MB that way. But then again, those are likely to be in memory already anyway. And most definitely, they reside in a library, available as const .text on the harddisk. To put that into perspective: We&#8217;re talking about only a handful megabytes here. In physical size actually less than a hires desktop background image, smaller than some icon themes, or roughly 10% of a full linux-2.6.8 kernel + modules binary footprint (41MB). Also <a href="http://people.redhat.com/drepper/dsohowto.pdf">symbol resolution performance</a> doesn&#8217;t necessarily improve through splits, <a href="http://udrepper.livejournal.com/">Ulrich Drepper</a> has a few words on <a href="http://people.redhat.com/drepper/no_static_linking.html">multiple DSOs during deployment</a>. </p>
<p> Given that selecting Gtk+ subcomponents to allow selective shrinkage for size constrained embedded devices via configure.in options is on our TODO list anyway; for this set of libraries: <strong>Size is not worth a split</strong>! </p>
<p> Of course, other aspects not reflected in library size weigh in much more strongly. Such as the ability to build different user communities around projects (e.g. for Cairo vs. Glib) or the reduced dependency chain (<a href="http://de.wikipedia.org/wiki/SSHFS">sshfs</a> and Qt wouldn&#8217;t depend on GLib if it drew in Pango or Gtk+). <br /> So while for the vast majority of applications the GLib split off doesn&#8217;t make a huge difference technically, software evolution arguments make all the difference, definitely justifying a separation. The GLib internal splits are definitely not worth the hassle and conceptual boundaries though, if we ever break binary compatibility again, merging the GLib internal libraries and respective <a href="http://pkg-config.freedesktop.org">pkg-config</a> packages would be a good idea. </p>
<p> Back to my original problem&#8230; I&#8217;m now pretty convinced that merging Rapicorn with the Birnet utility library will most likely not pose a problem anytime soon. And <a href="http://doc.trolltech.com/4.1/qt4-intro.html#build-system">Qt 4 kindly demonstrates</a> that splits can also be carried out successfully later on during the game. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2007/08/17/17082007-what-are-elf-libraries-good-for-anyway/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>28.12.2006 G_SLICE=debug-blocks</title>
		<link>http://blogs.gnome.org/timj/2007/01/02/28122006-g_slicedebug-blocks/</link>
		<comments>http://blogs.gnome.org/timj/2007/01/02/28122006-g_slicedebug-blocks/#comments</comments>
		<pubDate>Tue, 02 Jan 2007 09:08:32 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2007/01/02/28122006-g_slicedebug-blocks/</guid>
		<description><![CDATA[ One of the typical problems with implementing an allocator is that all sorts of memory failures in programs get attributed to the allocator. That&#8217;s because messing up heap memory somewhere in a program or library usually messes up the allocator state even if it is implemented correctly. For several months now, we have been [...]]]></description>
			<content:encoded><![CDATA[<p> One of the typical problems with implementing an allocator is that all sorts of memory failures in programs get attributed to the allocator. That&#8217;s because messing up heap memory somewhere in a program or library usually messes up the allocator state even if it is implemented correctly. For several months now, we have been trying to track down and fix a very nasty memory corruption issue in <a href="http://beast.gtk.org">Beast</a> (<a href="http://bugzilla.gnome.org/show_bug.cgi?id=340437">#340437</a>), which could be hunted down to rare and racy triggering with <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Slices.html">GSlice</a> enabled, but not with <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-running.html#G_SLICE">G_SLICE=always-malloc</a> set. Valgrind&#8217;s memchecker didn&#8217;t help with this particular Beast bug and couldn&#8217;t possibly track all invalid GSlice uses. </p>
<p> So i sat down to implement a slice address and size validator to catch the most frequent GSlice misuses. The debugging validator consists of a flat fixed-size hashing tree with fairly big prime-sized nodes and binary searchable arrays to manage collisions in the hash buckets. This structure avoids circular dependencies with GSlice (like GHashTable and GTree would have it) and is still reasonably easy to implement. The hashing makes use of the approximately random distribution of allocator block addresses in the lower bits but fairly sequential distribution in the higher bits, so the structures are reasonably space efficient and can adapt in size incrementally with every new megabyte handed out by malloc(3)/memalign(3). This also keeps hash collisions on an acceptably low average for allocations within a 4GB address range. Using a single global structure keeps GSlice from scaling well across multiple threads, but i think that&#8217;s fair enough for a debugging mode validator. Quickly after running an early version of this validator, the cause of the above Beast bug was found and could be fixed. <code>
<pre>	$ G_SLICE=debug-blocks testcase
	GSlice: MemChecker: attempt to release block with invalid size: 0x80527e0 size=8 invalid-size=12
	Aborted</pre>
<p></code> The faulty code was mixing up GSList and GList nodes, which couldn&#8217;t be caught by the compiler because the use of <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#g-object-set-data">object data</a> and <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-The-Main-Event-Loop.html#g-timeout-add">timeout data</a> forces <code>void*</code> casts and gives up type safety: <code>
<pre>	void *slist = g_slist_alloc(); // void* gives up type-safety
	g_list_free (slist);           // corruption: sizeof (GSList) != sizeof (GList)</pre>
<p></code> At this point, the validator is in <a href="http://svn.gnome.org/svn/glib/">GLib SVN</a> and can be enabled with <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-running.html#G_SLICE">G_SLICE=debug-blocks</a>. </p>
<p> Another issue that some people might run into with the recent GSlice code is: <code>
<pre>	***MEMORY-WARNING***: GSlice: g_thread_init() must be called before all
	other GLib functions; memory corruption due to late invocation of
	g_thread_init() has been detected; this program is likely to crash,
	leak or unexpectedly abort soon...</pre>
<p></code> The correct workaround for that is to add an early <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Threads.html#g-thread-init">g_thread_init()</a> call to your program. More details can be found in the gtk-devel email: <a href="http://mail.gnome.org/archives/gtk-devel-list/2007-January/msg00005.html">bugs regarding late g_thread_init() calls</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2007/01/02/28122006-g_slicedebug-blocks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>25.01.2006 Allocation debugging with GLib</title>
		<link>http://blogs.gnome.org/timj/2006/01/25/25012006-allocation-debugging-with-glib/</link>
		<comments>http://blogs.gnome.org/timj/2006/01/25/25012006-allocation-debugging-with-glib/#comments</comments>
		<pubDate>Wed, 25 Jan 2006 12:49:47 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2006/01/25/25012006-allocation-debugging-with-glib/</guid>
		<description><![CDATA[ I just completed reworking the GSlice and g_malloc() memory debugging hooks. With this, GLib-2.10 (or the next GLib-2.9 development version due this weekend) will (without recompilation) support G_SLICE=always-malloc and G_DEBUG=gc-friendly. These cause all GSlice allocations to go through g_malloc() and g_free() instead and cause all released memory to be memset() to 0. This helps [...]]]></description>
			<content:encoded><![CDATA[<p> I just completed reworking the <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Slices.html">GSlice</a> and <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Allocation.html">g_malloc()</a> memory debugging hooks. With this, <a href="http://developer.gnome.org/doc/API/2.0/glib/">GLib-2.10</a> (or the next GLib-2.9 development version due this weekend) will (without recompilation) support <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-running.html#G_SLICE">G_SLICE=always-malloc</a> and <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-running.html#G_DEBUG">G_DEBUG=gc-friendly</a>. These cause all GSlice allocations to go through g_malloc() and g_free() instead and cause all released memory to be <a href="http://www.opengroup.org/onlinepubs/007908799/xsh/memset.html">memset()</a> to 0. This helps memory checkers to trace pointer lists and can be used to debug <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Allocation.html#g-malloc">g_malloc()/g_free()</a> and <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Slices.html#g-slice-new">g_slice_new()/g_slice_free()</a> allocation code to find and plug memory leaks: <code>
<pre>	G_SLICE=always-malloc G_DEBUG=gc-friendly valgrind --leak-check=full mybuggyprogram</pre>
<p></code> Or, in combination with <a href="http://www.gnu.org/software/libc/manual/html_node/Heap-Consistency-Checking.html">MALLOC_CHECK_</a>, it can be used to catch and debug invalid allocation/release calls: <code>
<pre>	G_SLICE=always-malloc G_DEBUG=gc-friendly MALLOC_CHECK_=2 gdb mybuggyprogram</pre>
<p></code> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2006/01/25/25012006-allocation-debugging-with-glib/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>20.12.2005 Tuning GSlice memory consumption</title>
		<link>http://blogs.gnome.org/timj/2005/12/20/20122005-tuning-gslice-memory-consumption/</link>
		<comments>http://blogs.gnome.org/timj/2005/12/20/20122005-tuning-gslice-memory-consumption/#comments</comments>
		<pubDate>Tue, 20 Dec 2005 13:22:46 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2005/12/20/20122005-tuning-gslice-memory-consumption/</guid>
		<description><![CDATA[ The other day, Tommi Komulainen pointed out to me that GSlice is using more memory than memchunks for him after bootup of the N770. Now, GSlice is supposed to be faster than memchunks, yes. And its supposed to scale far better across multiple threads. In the long run it is also meant to be [...]]]></description>
			<content:encoded><![CDATA[<p> The other day, <a href="http://blogs.gnome.org/tko">Tommi Komulainen</a> pointed out to me that <a href="http://cvs.gnome.org/viewcvs/glib/glib/gslice.c?view=markup">GSlice</a> is <a href="http://blogs.gnome.org/view/tko/2005/12/12/0">using more memory than memchunks</a> for him after bootup of the N770. Now, GSlice is supposed to be faster than memchunks, yes. And its supposed to scale far better across multiple threads. In the long run it is also meant to be more efficient in terms of memory consumption. <br /> However, that is mostly due to the fact that many code portions which use GMemChunk are keeping their own never-freeing trash stacks. Such code should now be migrated to the <a href="http://developer.gnome.org/doc/API/2.0/glib/glib-Memory-Slices.html">GSlice API</a> and the trash stacks should be removed. GSlice maintains its own working set memory in per-thread trash stacks. Home grown trash stacks will just waste memory and clutter up the cache lines. <br /> Also, using separate GMemChunks prevents chunks of equal sizes from being shared across a program, this again wastes memory and clutters up the cache lines. <br /> Because of the long-term wastage that GMemChunk application tends to build up, significant memory savings from GSlice are actually only to be expected for longer running programs which certainly is not a scenario met directly after N770 boot up ;) <br /> That being said, the original check-in of the slab allocator in the GSlice code does behave a bit greedy actually. Basically, it allocates a new page (4096 bytes on IA32) per every different size, memory chunks are allocated at (chunk sizes are aligned to 8 bytes on IA32). That means, initially allocating 8 + 16 + 24 + 32 + 40 bytes in separate chunks does require opening up of 5 caches, so it uses 5 * 4096 = 20KB already. I&#8217;ve tuned the most recent CVS version now to do more <a href="http://cvs.gnome.org/viewcvs/glib/glib/gslice.c?rev=1.8&amp;view=markup">economical caching</a>, so the above scenario now ends up at roughly the power-of-2 sums of 8*8, 16*8, 24*8, 32*8 and 40*8, which is approximately 1.6KB and can all be allocated from a single memory page. While this is a significant memory saver, it also does have some performance impacts. However, in all test scenarios on my machine, the GSlice performance didn&#8217;t drop by more than 5%. That&#8217;s probably bearable, considering how significant the savings are. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2005/12/20/20122005-tuning-gslice-memory-consumption/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>02.12.2005 Landing g_slice_new()</title>
		<link>http://blogs.gnome.org/timj/2005/12/02/02122005-landing-g_slice_new/</link>
		<comments>http://blogs.gnome.org/timj/2005/12/02/02122005-landing-g_slice_new/#comments</comments>
		<pubDate>Fri, 02 Dec 2005 05:56:15 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2005/12/02/02122005-landing-g_slice_new/</guid>
		<description><![CDATA[ I finally managed to finish up the new g_slice_*() allocator for GLib CVS and commit it. For most platforms, it should be a lot faster than malloc(), and on my machine it saves 20-30% in performance over allocating with mem-chunks. But most importantly, it does share equally sized chunks across a program, which mem-chunks [...]]]></description>
			<content:encoded><![CDATA[<p> I finally managed to finish up the new <a href="http://cvs.gnome.org/viewcvs/glib/glib/gslice.c?rev=1.2&amp;view=markup">g_slice_*() allocator</a> for GLib CVS and commit it. For most platforms, <a href="http://mail.gnome.org/archives/gtk-devel-list/2005-December/msg00031.html">it should be a lot faster than malloc()</a>, and on my machine it saves 20-30% in performance over allocating with mem-chunks. But most importantly, it does share equally sized chunks across a program, which mem-chunks didn&#8217;t, so they opened up several independent heaps of equally sized chunks, scattered all over the program and causing large wastage. <br /> I would like to thank <a href="http://live.gnome.org/MatthiasClasen">Matthias Clasen</a> for an <a href="http://bugzilla.gnome.org/show_bug.cgi?id=118439">initial version of the magazine cache</a> and <a href="http://space.twc.de/~stefan/">Stefan Westerfeld</a> for helping me with optimizing the common code paths. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2005/12/02/02122005-landing-g_slice_new/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>01.08.2005</title>
		<link>http://blogs.gnome.org/timj/2005/08/01/01082005/</link>
		<comments>http://blogs.gnome.org/timj/2005/08/01/01082005/#comments</comments>
		<pubDate>Mon, 01 Aug 2005 19:10:06 +0000</pubDate>
		<dc:creator>Tim Janik</dc:creator>
				<category><![CDATA[GLib]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/timj/2005/08/01/01082005/</guid>
		<description><![CDATA[ Today, i started working at imendio, we&#8217;re doing some pretty interesting hacking here, so i hope the job is going to be fun. 
 And, the hopefully last incarnation of the atomic ref-counting patch for GObject i blogged about earlier finally made it into CVS. With atomic ref-counting, GObject users still have to make [...]]]></description>
			<content:encoded><![CDATA[<p> Today, i started working at <a href="http://www.imendio.com">imendio</a>, we&#8217;re doing some pretty interesting hacking here, so i hope the job is going to be fun. </p>
<p> And, the hopefully last incarnation of the atomic ref-counting patch for GObject <a href="http://blogs.gnome.org/view/timj/2005/06/20/2">i blogged about earlier</a> finally <a href="http://cvs.gnome.org/viewcvs/glib/gobject/ChangeLog?rev=1.367&amp;view=markup">made it into CVS</a>. With atomic ref-counting, GObject users still have to make sure they don&#8217;t modify or read-out the same object concurrently from different threads (such as using <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#g-object-set-qdata">g_object_set_qdata()</a> on it or using object methods), they may however invoke <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#g-object-ref">g_object_ref()</a> and <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-The-Base-Object-Type.html#g-object-unref">g_object_unref()</a> concurrently without having to ensure mutual exclusion, the same goes for <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-GParamSpec.html">GParamSpec</a> and <a href="http://developer.gnome.org/doc/API/2.0/gobject/gobject-Closures.html">GClosure</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/timj/2005/08/01/01082005/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
