Problem in AlgebraDemonstration

46 views
Skip to first unread message

Chrisa23

unread,
Aug 31, 2010, 10:44:27 PM8/31/10
to retlang-dev
I have been taking another look at the tests and examples to avoid
asking questions that are answered there, but I ended up finding an
interesting "bug" in the AlgebraDemonstration...

The QuadraticSource class is not making use of the sourceFiber, and is
ultimately ran on the unit test thread... You can remove the fiber
from DoDemonstration() and the QuadraticSource class, and the test
succeeds...

I noticed the public PublishQuadratics() method, and did not see a
call within the QuadraticSource class or any use of the fiber other
than to call Dispose...

This does end up leading into a question about how you guys are
initiating objects that require "Starting"...

I have done the following:
- a private IChannel<object> that I subscribe to in the constructor
for Init/Start, and then the very last call in my constructor is to
Publish on that channel... (knowing that all constructor calls are on
the thread of the component doing the constructing.... I have made a
few mistakes in the past in the constructor leading to the wrong
thread doing work...)
- a public StartStop channel for external control
- a public Start() method that only publishes an object to a private
IChannel<object>
- in some cases timer intervals can be set in the constructor to
achieve the same purpose

For simple component abstractions like external Start/Stop, I have
switched back and forth between exposing the channel and hiding it,
but have kind of settled on exposing the channel...

Chris

gnash

unread,
Oct 14, 2010, 7:10:20 PM10/14/10
to retlang-dev
You are correct. The sourceFiber is unused. I removed the code and
checked it in.

Generally we handle all Init/Start at startup in the container thread
(main) and all teardown/shutdown at shutdown also in the container
thread. Any tasks that must be done synchronously with the IFiber we
use the Enqueue method, but this is quite rare. Also, we generally do
not have containers that are created in the middle of execution.

Chrisa23

unread,
Oct 20, 2010, 7:44:09 AM10/20/10
to retlang-dev
"Also, we generally do not have containers that are created in the
middle of execution."

I am curious if this statement is based on the particular domain of
your apps or if you feel this is a good design principle with Retlang?

I would be very interested to hear whatever you can tell me about the
types of apps you use Retlang with.

Peter Gum

unread,
Oct 20, 2010, 9:28:36 AM10/20/10
to retla...@googlegroups.com

I would echo Chrisa23’s interest in usage scenarios/examples, including perhaps pointers to other sources. Thanks.

-Pete

--
You received this message because you are subscribed to the Google Groups "retlang-dev" group.
To post to this group, send email to retla...@googlegroups.com.
To unsubscribe from this group, send email to retlang-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/retlang-dev?hl=en.


No virus found in this message.
Checked by AVG - www.avg.com
Version: 10.0.1136 / Virus Database: 422/3206 - Release Date: 10/19/10

Graham Nash

unread,
Oct 20, 2010, 4:02:21 PM10/20/10
to retla...@googlegroups.com
Not sure.  There may be domains where that is appropriate, especially in those where the threads are not kept very busy.

Unfortunately, I don't have more examples for you.  I am happy to comment on any you wish to post however.

Reply all
Reply to author
Forward
0 new messages