Hi Phil,

Yes, multi core support and communication is important, having that in pharo could be great.

Unfortunately, no I actually have no usable project for that, mine is not
a communication project and still really in pre-alpha stage.

For now, I'm starting with Zinc, 0mq is just from a prospective eye.
I have no  experience with 0mq, I discovered it  just few days ago
(see Marten's messages), but it seemsto be easy to use.
What I did is just read the echo server sample,
and threw few lines in a workspace to see how it works (here modified to send/receive 8k pages instead of echoing the message). I am also interested in something more elaborate , as I will probably use it later,
I will think about a simple test project (the workspace here is just
a very first experiment) and see what I can do.
The bindings are FFI, may be it should be rewritten/modified to use native boost
(I know only the name here).

If you want to look here it is, it's very basic and only the REQ/REP pattern
(not sure the other works, I tried but the vm hanged, may be my fault,
may be it also requires more work).
You have to load Panu 0mq bindings before and put a zmq.dll in your path.


The server (kill the server with Process browser to stop it)
"====================================== classic sockets - REQ/REP server"
[       | context serverSocket request count |
        [       count := 0 .
                context := ZmqContext new .
                serverSocket := ZmqResponseSocket  new.
                serverSocket bind: 'tcp://*:5555' .
                [ true]         
                        whileTrue:
                                [ request := serverSocket receive . "fake 
request"
                                serverSocket send: (ByteArray new: 8*1024 ). "block 
response"
                                count := count+1 ].
        ] ensure:
                [ serverSocket close.
                ('server exited -', count asString, ' pages sent ') explore ]   
        
] forkAt: Processor "systemBackgroundPriority" userBackgroundPriority "lowIOPriority hangs" .

The client (5 sec bench of request/reply) :
"======================================== classic sockets - REQ/REP client"
[       | context socket response count bench |
[       context := ZmqContext new .
        socket :=  ZmqRequestSocket new.
        count := 0.
        socket connect: 'tcp://127.0.0.1:5555' .
        bench := [      socket send: 'get xxx' asByteArray .  "fake request"
                                response := socket receive .
                                count := count + 1 ] bench .
] ensure: [
        socket close.
        bench explore.
        ('client asked for ',count asString) explore ]
] forkAt: Processor userBackgroundPriority   "lowIOPriority" .


Le 11/10/2014 12:31, p...@highoctane.be a écrit :
Alain,​

Yes, 0mq seems to be a good way to go as there is just more support
across the board.

Have you a project on Smalltalkhub (or elsewhere) with your experiments
so that I could have a look?
I've updated the 0MQ bindings page to list the smalltalkhub pharo client
and also had a look at what was in the GST client.

It would be nice to port the GST code to Pharo so that we would have a
nice package.

0mq could help with the multicore support very nicely. We are going to
use SDL for low level, why not go 0mq for interimage communication? It
makes sense to me.

Phil



Reply via email to