RE: Why is FlowInterpreter SingleThreaded?

2003-10-21 Thread Carsten Ziegeler
Sylvain Wallez wrote: After looking carefully, the interpreter must be SingleThreaded, even if thread safe... This is because although an intepreter can handle concurrent requests, each sitemap must have a different instance, since the interpreter holds the scripts defined in a

Re: Why is FlowInterpreter SingleThreaded?

2003-10-21 Thread Ugo Cei
Sylvain Wallez wrote: After looking carefully, the interpreter must be SingleThreaded, even if thread safe... This is because although an intepreter can handle concurrent requests, each sitemap must have a different instance, since the interpreter holds the scripts defined in a map:flow

Re: Why is FlowInterpreter SingleThreaded?

2003-10-21 Thread Sylvain Wallez
Ugo Cei wrote: Sylvain Wallez wrote: After looking carefully, the interpreter must be SingleThreaded, even if thread safe... This is because although an intepreter can handle concurrent requests, each sitemap must have a different instance, since the interpreter holds the scripts defined in

Re: Why is FlowInterpreter SingleThreaded?

2003-10-21 Thread Sylvain Wallez
Christopher Oliver wrote: Again I know nothing about Avalon, but there seems to be some conceptual confusion between Stateless and ThreadSafe. Stateless objects are of course thread-safe but stateful objects may be also. A container that automatically turns a ThreadSafe component into a

Re: Why is FlowInterpreter SingleThreaded?

2003-10-21 Thread Berin Loritsch
Christopher Oliver wrote: Again I know nothing about Avalon, but there seems to be some conceptual confusion between Stateless and ThreadSafe. Stateless objects are of course thread-safe but stateful objects may be also. A container that automatically turns a ThreadSafe component into a

RE: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Carsten Ziegeler
Christopher Oliver wrote: I think SingleThreaded is rather misleading in this case. I know nothing about Avalon but from my experience it appears one flow interpreter is created per sitemap. However, this instance is definitely accessed by many threads concurrently. I had to put my own

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Sylvain Wallez
Carsten Ziegeler wrote: Christopher Oliver wrote: I think SingleThreaded is rather misleading in this case. I know nothing about Avalon but from my experience it appears one flow interpreter is created per sitemap. However, this instance is definitely accessed by many threads concurrently.

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Torsten Curdt
After looking carefully, the interpreter must be SingleThreaded, even if thread safe... This is because although an intepreter can handle concurrent requests, each sitemap must have a different instance, since the interpreter holds the scripts defined in a map:flow statement. So if the

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Sylvain Wallez
Torsten Curdt wrote: After looking carefully, the interpreter must be SingleThreaded, even if thread safe... This is because although an intepreter can handle concurrent requests, each sitemap must have a different instance, since the interpreter holds the scripts defined in a map:flow

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Torsten Curdt
snip/ This means that the interpreter must externalize its state (compiled scripts and global scope) in an object stored in the treeprocessor for a sitemap (in the FlowNode). yes Or another solution is to change Interpreter into InterpreterFactory: the state mentioned above would then be the

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Sylvain Wallez
Torsten Curdt wrote: snip/ This means that the interpreter must externalize its state (compiled scripts and global scope) in an object stored in the treeprocessor for a sitemap (in the FlowNode). yes Or another solution is to change Interpreter into InterpreterFactory: the state mentioned

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Torsten Curdt
huh? do you mean there is exactly one interpreter for a specific state accessable through the factory? please explain :) Let's explain it in (pseudo-)code: FlowNode.java: // the flow interpreter for this sitemap private Interpreter interpreter; public void initialize() { IntepreterFactory

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Sylvain Wallez
Torsten Curdt wrote: huh? do you mean there is exactly one interpreter for a specific state accessable through the factory? please explain :) Let's explain it in (pseudo-)code: FlowNode.java: // the flow interpreter for this sitemap private Interpreter interpreter; public void

Re: Why is FlowInterpreter SingleThreaded?

2003-10-20 Thread Christopher Oliver
Again I know nothing about Avalon, but there seems to be some conceptual confusion between Stateless and ThreadSafe. Stateless objects are of course thread-safe but stateful objects may be also. A container that automatically turns a ThreadSafe component into a singleton seems broken to me.

Why is FlowInterpreter SingleThreaded?

2003-10-15 Thread Carsten Ziegeler
Just curious for the reason why o.a.c.c.flow.AbstractInterpreter implements SingleThreaded (and therefore the flow interpreter as well)? SingleThreaded means that for each lookup a new instance is created. Carsten

Re: Why is FlowInterpreter SingleThreaded?

2003-10-15 Thread Christopher Oliver
I think SingleThreaded is rather misleading in this case. I know nothing about Avalon but from my experience it appears one flow interpreter is created per sitemap. However, this instance is definitely accessed by many threads concurrently. I had to put my own synchronization code into