I've been experimenting with Axon's threaded components. Currently incoming messages are delivered to the wrapper, which forwards them to the thread at its next scheduler slot. I've written a "threadedsink" class to replace the "realsink" class used when creating an inbox. It's based on Queue.Queue - the append method puts a message on the queue and wakes up the thread directly, without the wrapper component getting involved.

Similarly, the threaded component's "send" method can check to see if the receiving inbox's sink is a "threadedsink" object, and if so append the outgoing message directly. Otherwise the usual threaded component out queue is used.

These two changes give me much better performance with pipelines of threaded components. Messages flow from one component to the next without the scheduler having to do anything.

Note that I haven't given much thought to what happens if links are made or unmade while messages are flowing. That's something I try and avoid doing. (Turn the water off before disconnecting the hose.)
--
Jim Easterbrook
Senior Research Engineer

BBC Research & Development South Lab
BBC Centre House
56 Wood Lane
London W12 7SB

Phone:  +44 303 040 9705
Mobile: +44 7590 307002
FAX:    +44 20 8811 8815

--
You received this message because you are subscribed to the Google Groups 
"kamaelia" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kamaelia+unsubscr...@googlegroups.com.
To post to this group, send email to kamaelia@googlegroups.com.
Visit this group at http://groups.google.com/group/kamaelia.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to