[TFUI] Re: [XP] Tests for concurrent systems....
Phlip <phlipcpp-/[email protected]>
| Newsgroups | gmane.comp.programming.test-first-user-interfaces,gmane.comp.programming.extreme-programming |
|---|---|
| Message-ID | <[email protected]> |
John Roth wrote:
(a good list).
The point is to thread only for one async task, and to
dispatch that task back to your main thread, such as
with PostMessage(), when it finishes. Don't wander
around in both threads, and lock every damned
primitive between them. Libraries are also a bad
example here.
> 2. You have to do tasks that have embedded long
> waits that you can't get around - such as common
> printing tasks or some canned dialogs.
And that's another thing. MS Windows supports two ways
to raise a dialog box. Create() returns immediately,
but DoEvents() blocks until the dialog returns. That
lets you write naive code like:
if (aDialog.DoEvents()
doOkayButton();
That destroys event-driven paradigm in exchange for a
tiny bit of programmer convenience.
However, when you inspect the effects of many dialogs
in shipped applications (meaning when you break them),
you will discover they used Create(), and they
disabled the parent window.
MS Windows needs this for many custom controls,
because DoEvents() does not call
PreTranslateMessage(). I think a good rule is "A
program has one and only one event loop". Plenty of
exceptions are possible...
BTW another reason to ask Amr's question is this: What
to do with legacy code that made a bird's nest of
multiple threads? Refactor? Unit tests, by definition,
cannot constrain the effects of threads. So the bugs
live on.
=====
Phlip
http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
__________________________________
Do you Yahoo!?
Yahoo! Domains Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/nhFolB/TM
---------------------------------------------------------------------~->
To unsubscribe, email:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/TestFirstUserInterfaces/
<*> To unsubscribe from this group, send an email to:
TestFirstUserInterfaces-unsubscribe-hHKSG33TihhbjbujkaE4pw@public.gmane.org
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/