Hi!

I don't think mina-list is the right list for this.

Some thoughts, anyway:
"shared memory" between threads should be synchronized somehow (doesn't mean it 
has to be in a synchronized block), so it's a big performance killer to 
synchronize all variables. If you need synchronized variables read the 
documentation for the "volatile" flag and the API for the atomic- and 
concurrency-packages will be usefull as well.
If you implement your own "thread model" in a single thread, your application 
won't scale very well to multi processor systems. A simple form of this "thread 
model" is the Executor created by "Executors.newSingleThreadExecutor()". But 
it's poison for scalability!!!

My opinion: using some volatile flags, Locks and concurrency collections at the 
right positions will surely do the trick and lead to a better scalability. Even 
a little oversynchronisation will be better than a "single thread thread model" 
;-)

regards

Steve

> Simon Funnell [mailto:[EMAIL PROTECTED] wrote:
>
> Dear List,
>
> This is not exactly Mina specific, its more general, but its close to
> the problem Mina surrounds. I have been working on an approach to
> concurrency and I have come to the point where the Java Thread model is
> causing me problems. I would like to create my own threading model that
> does away with shared memory and thread memory, so there is just shared
> memory. My original idea was to use a single thread and implement my
> own
> threads within that thread. The difficulty with this is that there is
> still copying from shared memory to thread working memory (as I
> understand it). I would like to cut out this shared memory to thread
> memory and back to shared memory copying. Is this possible?
>
> Thanks for any replies.
>
> Regards,
>
> Simon

Reply via email to