<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ilia Tulchinsky's software blog</title>
	<atom:link href="http://iliat.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://iliat.wordpress.com</link>
	<description>Musings on software,the universe and everything</description>
	<lastBuildDate>Mon, 09 Jun 2008 00:30:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='iliat.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ilia Tulchinsky's software blog</title>
		<link>http://iliat.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://iliat.wordpress.com/osd.xml" title="Ilia Tulchinsky&#039;s software blog" />
	<atom:link rel='hub' href='http://iliat.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Premature unit tests considered harmful</title>
		<link>http://iliat.wordpress.com/2008/06/09/premature-unit-tests-considered-harmful/</link>
		<comments>http://iliat.wordpress.com/2008/06/09/premature-unit-tests-considered-harmful/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 00:30:07 +0000</pubDate>
		<dc:creator>iliat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[unittest]]></category>

		<guid isPermaLink="false">http://iliat.wordpress.com/?p=8</guid>
		<description><![CDATA[You know the mantra: write unit tests, write them often, write more of them, write them before you write your code, write them instead of your code. After experimenting with various approaches I submit that writing too many unit tests too early in the design stage is actually harmful. I am not talking about adding [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=8&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>You know the mantra: write unit tests, write them often, write more of them, write them before you  write your code, <span style="text-decoration:line-through;">write them instead of your code</span>.  After experimenting with various approaches I submit that writing too many unit tests too early in the design stage is actually harmful.</p>
<p>I am not talking about adding minor features to a huge bulk of existing code &#8211; in this cases unit tests before code are a great idea, provided that the rest of the code is covered. What I am talking about is relatively large subsystem or independent service which you are designing from scratch.</p>
<p>In this case chance are that however carefully you have designed things on paper, your design is going to change and evolve as you code.  You will discover that your assumptions about 3d party systems you have to interface with or components you have to use are wrong. Browser bugs and general weirdness will rear their ugly heads. Your decomposition will have to change.  New possibilities for abstraction will become apparent. Certain interfaces will have to be extended, others will prove unnecessary rich. You know the drill.</p>
<p>Well, what happens when you write you unit tests before your code ? You <strong>commit</strong> to certain decomposition and a set of interfaces. You introduce a bias in your design thinking because at the back of your mind there are all these unit tests that will have to be rewritten, and is it really that harmful to leave these useless methods here (after all they are covered by tests) or do we really need to refactor this common functionality out of this class (after all we would have to write new tests and change existing ones) ?</p>
<p>The other evil of premature unit tests is that you interfaces will be driven by what is convenient for tests and not the intended functionality. Are these classes split for a reason or only so it&#8217;s easier to substitute a mock ? Are these setters in the interface necessary or you need to set up the internal state for the test ? More about this in my previous post.</p>
<p>And so you end up with bloated interfaces and a sizable design inertia. Not to mention that any comments by reviewer which would result in a significant change of interfaces or decomposition and therefore trigger a cascade of unit test changes are bound to send you on a quest for best excuses to leave things as they are. My preccccioussss unit tests.</p>
<p>Yet another harmful aspect of premature unit tests is that it wastes the time better spent on flashing out interfaces and finding unforeseen pitfalls and constraints.</p>
<p>I my opinion it is far more beneficent to spend two or three weeks after the initial design coding and prototyping and only when you have the skeleton of the service and major pieces even in sketchy form are in place &#8211; turn around and go full blast on unit tests, covering all the code written so far. From that point on write tests together with the code or even before the code.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/iliat.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/iliat.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iliat.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iliat.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iliat.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iliat.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iliat.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iliat.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iliat.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iliat.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iliat.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iliat.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iliat.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iliat.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iliat.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iliat.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=8&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iliat.wordpress.com/2008/06/09/premature-unit-tests-considered-harmful/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95b24d19053a9c3e09efe2de124b852c?s=96&#38;d=identicon" medium="image">
			<media:title type="html">iliat</media:title>
		</media:content>
	</item>
		<item>
		<title>Fractured facades</title>
		<link>http://iliat.wordpress.com/2008/06/01/fractured-facades/</link>
		<comments>http://iliat.wordpress.com/2008/06/01/fractured-facades/#comments</comments>
		<pubDate>Sun, 01 Jun 2008 02:12:07 +0000</pubDate>
		<dc:creator>iliat</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://iliat.wordpress.com/?p=7</guid>
		<description><![CDATA[If you&#8217;ve ever tried to understand a large system written in Java you likely experienced repeated frustrations when trying to find the place in code that actually performs some operation you are looking for. To attain the holy grail of the actual code you must wade through countless factories, adapters, policies, injector methods, abstract classes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=7&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve ever tried to understand a large system written in Java you likely experienced repeated frustrations when trying to find the place in code that actually performs some operation you are looking for.  To attain the holy grail of the actual code you must wade through countless factories, adapters, policies, injector methods, abstract classes and interfaces. The code reads like a bad novel overburdened with banal and  needlessly detailed descriptions of the scenery and surroundings punctuated by rare moments of action.</p>
<p>You can&#8217;t just go ahead and do something, no, you must set up you objects, properties, assemble a <a href="http://en.wikipedia.org/wiki/Rube_Goldberg_machine">Rube Goldberg machine</a> of an object tree and then almost as an afterthought give it a gentle push to actually execute something. And so 2 + 2 becomes<br />
<em>MathOperationFactory.getFactory().createOperator(MathOperators.Plus).imbueWithPolicy(new IntegerOperationsPolicy()).appendArgument(2).appendArgument(2).do();</em></p>
<p>Actually that&#8217;s one of the giveaways: when you have a lot of classes with names like &#8220;Factory&#8221; or &#8220;Manager&#8221; and methods that start with &#8220;imbue&#8221;, &#8220;decorate&#8221; and above all methods like &#8220;do&#8221;, &#8220;run&#8221;, &#8220;execute&#8221;.</p>
<p>For a much better articulated version of this rant, read Steve Yegge&#8217;s <a href="http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html">&#8220;Execution in the Kingdom of Nouns&#8221;</a>.</p>
<p>One of the big problems with this approach is that it prevents classes for delivering on their encapsulation promise. I mean you can&#8217;t tell what a class does anymore because so much of it is determined by other classes with which it has to be assembled to perform anything meaningful.</p>
<p>Sometimes this over-distribution of responsibility is a sign of a bad design, premature and excessive abstraction, attempts to foresee variability points in the code and prepare for eventual changes, which invariably occur not where the original designer carefully prepared their policies and interfaces but in some aspect of the design which requires major tinkering with the code (e.g. instead of ability to read from network stream in addition to file what you actually have to do is make your huge subsystem thread safe).</p>
<p>But lately I have been seeing more and more classes with interfaces bloated for the sake of unit tests.<br />
Classes get more setters, functionality that could be hidden from the outside world in inner classes is publicly exposed, the code is spread around so as to make testing and mocking easier but as mentioned before that means you have to get 10 classes together and tie them with setters in order to get something that can perform a useful operation. And thus you get a fractured facade &#8211; instead of acting as a facade that simplifies our comprehension of a behavior whose complex details are hidden in the class implementation we a lot of the complexity manifested in the class interface.</p>
<p>This is where dynamic languages like Javascript shine. Since you can modify objects on the fly and imbue them with additional properties and override or stub out any method &#8211; there is no need to put the infrastructure for unit tests in class&#8217;s public interface. Interfaces remain simple and focus on what the class is supposed to do.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/iliat.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/iliat.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iliat.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iliat.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iliat.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iliat.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iliat.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iliat.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iliat.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iliat.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iliat.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iliat.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iliat.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iliat.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iliat.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iliat.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=7&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iliat.wordpress.com/2008/06/01/fractured-facades/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95b24d19053a9c3e09efe2de124b852c?s=96&#38;d=identicon" medium="image">
			<media:title type="html">iliat</media:title>
		</media:content>
	</item>
		<item>
		<title>I&#8217;m back + some musings on recordsets vs. objects</title>
		<link>http://iliat.wordpress.com/2008/05/25/im-back-some-musings-recordsets-vs-objects/</link>
		<comments>http://iliat.wordpress.com/2008/05/25/im-back-some-musings-recordsets-vs-objects/#comments</comments>
		<pubDate>Sun, 25 May 2008 16:16:24 +0000</pubDate>
		<dc:creator>iliat</dc:creator>
				<category><![CDATA[blogs]]></category>
		<category><![CDATA[Databases]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://iliat.wordpress.com/?p=6</guid>
		<description><![CDATA[Quick summary of what happened since my last posting: I interviewed for Google and so was busy recalling all the wonderful algorithms I never used in the course of my work, I got hired and am working in Waterloo, having lots of fun and adjusting to a completely new environment both in terms of tools, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=6&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Quick summary of what happened since my last posting: I interviewed for Google and so was busy recalling all the wonderful algorithms I never used in the course of my work, I got hired and am working in Waterloo, having lots of fun and adjusting to a completely new environment both in terms of tools, problem space and process. I&#8217;m hoping to resume these software related musings as the learning curve pressure is subsiding.</p>
<p>I have observed a sort of an anti-pattern in object oriented data access layers that treat databases as nothing more than a black-box object persistence store where object graphs are dumped and from which they are reconstituted. You can usually spot this approach if you notice that almost all SELECTs and INSERTs return or affect one record or a scalar.</p>
<p>The nice thing about it is that it allows abstraction of storage and all the interesting processing happens in a pure object oriented universe. The trouble is that it usually leads to abysmal performance since the power of a  relational engine lies in dealing with large sets of data and this power remains underutilized when operations that could have been expressed as SQL on the database side are shifted to the data layer code.</p>
<p>The typical example is a code that retrieves ids of all objects required for the operations and then loops over these, reconstituting each object from 5 JOINed tables a record at a time and then iterating over this object graph to perform the operation.</p>
<p>If we but dare to break the abstraction and change the granularity to deal with sets of objects rather than individual objects we can utilize the power of the database to the fullest. This is why I think it wrong in many cases to model nouns as objects and instead propose modeling sets of nouns as objects.</p>
<p>An this brings be to two camps of developers: &#8220;object graph&#8221; camp and &#8220;recordset&#8221; camp.</p>
<p>The object graph camp likes to perform all operations on nice object graphs and can&#8217;t wait to liberate object state from the messy SQL /recordset persistence (that&#8217;s when you also hear &#8220;and if we want we could use some other storage rather than database since it&#8217;s all so abstracted&#8221;).</p>
<p>The recordset camp stays close to the database representation and usually loves data binding features in the UI framework since they allow almost direct propagation of database results and remove all the tedious<br />
&#8220;for &#8221; loops that make objects out of records and then loop over objects to populate UI controls.<br />
The trouble with recordset camp is that it does not know where to locate the logic that would normally be present in per-record objects in the object graph case. The anti-pattern here is to stick this logic too close to the UI.</p>
<p>So what logic is usually required ? One kind I would call &#8220;checks&#8221; that is validations that are performed when something is added or changed in the data set. The other I would call &#8220;decorations&#8221; &#8211; these usually create or update dataset using calculations or obtaining data from sources other than the database (network, user). The common pattern in DB driven apps is: get data from DB, decorate it with calculated and extra-db data, pass it to UI for rendering, get user command+data from UI, check it and add it to the dataset, write to DB.</p>
<p>One approach that I have used rather successfully is to create an object corresponding to a dataset which contains all the required checks and decorations but has no state. All it&#8217;s operations are tied to the recordset object in runtime through callbacks (onRecordAdded, onFieldChanged, etc.). The nice thing about this approach is that the object in this case contains all and ONLY the business logic leaving all the data manipulation in the hands of framework supplied dataset object. And we can still use an ability of UI controls to bind directly to the dataset.</p>
<p>This approach may only be good for typical business apps but I think it finds a nice middle ground between the unneeded and slow over-complication of object graphs and a messy databinding-with-logic-in-UI &#8220;VisualBasic&#8221; approach.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/iliat.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/iliat.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iliat.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iliat.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iliat.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iliat.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iliat.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iliat.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iliat.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iliat.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iliat.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iliat.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iliat.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iliat.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iliat.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iliat.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=6&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iliat.wordpress.com/2008/05/25/im-back-some-musings-recordsets-vs-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95b24d19053a9c3e09efe2de124b852c?s=96&#38;d=identicon" medium="image">
			<media:title type="html">iliat</media:title>
		</media:content>
	</item>
		<item>
		<title>.NET CF does not support stackalloc</title>
		<link>http://iliat.wordpress.com/2007/08/15/net-cf-does-not-support-stackalloc/</link>
		<comments>http://iliat.wordpress.com/2007/08/15/net-cf-does-not-support-stackalloc/#comments</comments>
		<pubDate>Wed, 15 Aug 2007 01:48:00 +0000</pubDate>
		<dc:creator>iliat</dc:creator>
				<category><![CDATA[.NETCF]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[WinCE]]></category>

		<guid isPermaLink="false">http://iliat.wordpress.com/2007/08/15/net-cf-does-not-support-stackalloc/</guid>
		<description><![CDATA[stackalloc allows allocation of unmanaged memory on the stack usually to be passed to other unmanaged functions.  After an hour of debugging InvalidProgramException I finally used usenet to confirm my suspicion &#8211; stackalloc is not supported under .NET CF. It will compile but will not work. The workaround is to allocate managed array and then use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=5&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn2.microsoft.com/en-us/library/cx9s2sy4(VS.71).aspx" title="stackalloc">stackalloc</a> allows allocation of unmanaged memory on the stack usually to be passed to other unmanaged functions. </p>
<p>After an hour of debugging InvalidProgramException I finally used usenet to confirm my suspicion &#8211; <a href="http://groups.google.ca/group/microsoft.public.dotnet.framework.compactframework/browse_thread/thread/bdba361f8b47030b/77b3f0369a7332ea?lnk=st&amp;q=stackalloc+.net+cf&amp;rnum=1#77b3f0369a7332ea">stackalloc is not supported under .NET CF</a>. It will compile but will not work. The workaround is to allocate managed array and then use <strong>fixed.</strong></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/iliat.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/iliat.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iliat.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iliat.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iliat.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iliat.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iliat.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iliat.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iliat.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iliat.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iliat.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iliat.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iliat.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iliat.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iliat.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iliat.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=5&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iliat.wordpress.com/2007/08/15/net-cf-does-not-support-stackalloc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95b24d19053a9c3e09efe2de124b852c?s=96&#38;d=identicon" medium="image">
			<media:title type="html">iliat</media:title>
		</media:content>
	</item>
		<item>
		<title>Thread priorities in WinCE</title>
		<link>http://iliat.wordpress.com/2007/07/30/thread-priorities-in-wince/</link>
		<comments>http://iliat.wordpress.com/2007/07/30/thread-priorities-in-wince/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 04:23:47 +0000</pubDate>
		<dc:creator>iliat</dc:creator>
				<category><![CDATA[embedded]]></category>
		<category><![CDATA[Multithreading]]></category>
		<category><![CDATA[WinCE]]></category>

		<guid isPermaLink="false">http://iliat.wordpress.com/2007/07/30/thread-priorities-in-wince/</guid>
		<description><![CDATA[Lately I&#8217;ve been doing some real-time WinCE embedded development (no oximorons, for what we need to do it&#8217;s real-time enough).  So there I was, trying to give my thread in WinCE a real-time priority, using the trusty old SetThreadPriority which returned success code but failed to give me the real-time behavior what I wanted.  Spent some time making sure [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=4&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been doing some real-time WinCE embedded development (no oximorons, for what we need to do it&#8217;s real-time enough). </p>
<p>So there I was, trying to give my thread in WinCE a real-time priority, using the trusty old SetThreadPriority which returned success code but failed to give me the real-time behavior what I wanted.  Spent some time making sure that it&#8217;s not some silly bug and then more time googling. And to think that I was 2 pages away from it  in the WinCE reference book&#8230; Turns out that there a parallel system of setting priorities for threads under WinCE : <a target="_blank" href="http://msdn2.microsoft.com/en-us/library/aa450596.aspx">CeSetThreadPriority</a>.</p>
<p>It allows you to set the &#8220;real&#8221; real-time priorities from 0 to 255 whereas SetThreadPriority only deals with the lamer range of 248 through 255. It&#8217;s also important to know that unlike in Windows, there is no concept of process priority that sets a base for thread priorities. The only thing that matters is a thread priority , be it a thread in devices.exe or you user thread in the app.</p>
<p>Just like in Windows the scheduler implements a priority inversion mechanism where the low priority thread&#8217;s priority is temporarily boosted while a higher priority thread waits for it. So if you are writing a thread that needs a really precise real-time behaviour but are afraid that it will interfere with a device driver on which this same thread depends &#8211; do not worry: while you thread is waiting on that driver the driver&#8217;s thread priority will be boosted.</p>
<p>While playing with all of these I discovered a very informative blog by <a href="http://blogs.msdn.com/sloh/">Sue Loh</a> from WinCE dev. team. <a href="http://blogs.msdn.com/sloh/archive/2005/05/17/Introduction-to-Remote-Kernel-Tracker.aspx">Remote Kernel Tracker</a> is worth a special mention a an essential tool for figuring our how your thread scheduling really works.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/iliat.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/iliat.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iliat.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iliat.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iliat.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iliat.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iliat.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iliat.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iliat.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iliat.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iliat.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iliat.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iliat.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iliat.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iliat.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iliat.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=4&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iliat.wordpress.com/2007/07/30/thread-priorities-in-wince/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95b24d19053a9c3e09efe2de124b852c?s=96&#38;d=identicon" medium="image">
			<media:title type="html">iliat</media:title>
		</media:content>
	</item>
		<item>
		<title>The title of the first post</title>
		<link>http://iliat.wordpress.com/2007/07/30/the-title-of-the-first-post/</link>
		<comments>http://iliat.wordpress.com/2007/07/30/the-title-of-the-first-post/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 03:57:02 +0000</pubDate>
		<dc:creator>iliat</dc:creator>
				<category><![CDATA[blogs]]></category>

		<guid isPermaLink="false">http://iliat.wordpress.com/2007/07/30/the-title-of-the-first-post/</guid>
		<description><![CDATA[In this, the first posting, the author unsuccessfully attempts to outline reasons for imposing his creative output on the web and tries to hide beneath a veneer of a self effacing irony the fact that he&#8217;s starting yet another software related blog at the time when even his neighbor’s dog has a Technorati profile. Not [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=3&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:12pt;font-family:'Times New Roman';">In this, the first posting, the author unsuccessfully attempts to outline reasons for imposing his creative output on the web and tries to hide beneath a veneer of a self effacing irony the fact that he&#8217;s starting yet another software related blog at the time when even his neighbor’s dog has a Technorati profile. Not realizing how tired and contrived this self-mocking style sounds the author then states that he apparently has thoughts, opinions and questions related to software development which he can’t be talked out of sharing with the world, believing that putting them on the web might benefit someone, lead to interesting discussions or at least act as a writing therapy.</span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/iliat.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/iliat.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/iliat.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/iliat.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/iliat.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/iliat.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/iliat.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/iliat.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/iliat.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/iliat.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/iliat.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/iliat.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/iliat.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/iliat.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/iliat.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/iliat.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=iliat.wordpress.com&amp;blog=1351512&amp;post=3&amp;subd=iliat&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://iliat.wordpress.com/2007/07/30/the-title-of-the-first-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95b24d19053a9c3e09efe2de124b852c?s=96&#38;d=identicon" medium="image">
			<media:title type="html">iliat</media:title>
		</media:content>
	</item>
	</channel>
</rss>
