Posts

Showing posts with the label multi-threading

erlang ! hello

On Tuesday while reading Programming Erlang on suggestion of Andreas Cardeneo from the Research Center for Information Technology of the University of Karlsruhe , I started to experiment in Haskell with typed channels and lightweight threads to imitate Erlang style processes and networks thereof. Here is the very early and raw code from a few hours of exploration. And here is a simple interactive session in which a server is created that reads strings into integers. These integers then get _distributed one at a time_/_dealt_ to a first layer of 3 parallel nodes and they then travel to a second layer: *Erlang> (server,out) ← serve (read :: String → Integer) *Erlang> l1ts ← create 3 :: IO ([Chan Integer]) *Erlang> did ← deal move ([(\y → y - x) | x ← [1..3]]) out l1ts *Erlang> l2ts ← create 3 :: IO ([Chan Integer]) *Erlang> tids ← sequence $ zipWith (link move (2 *)) l1ts l2ts *Erlang> server ·· [ show x | x ← [2..4] ] *Erlang> all_ flush l2ts -- [[2],[2],[2]]...

Multi-threading, Part of Speech, Matoed 2005

Image
I am busy with my studies and cannot spend much time on development for the time being. All little what I do is test some ideas and the design of the class library. One of the tests I conducted was to see how much of a performance gain my single-file frequency listing routines might achieve on multi-core processors with multi-threading. So I decided to write some methods that help split a 140MB file into segments which can be processed on individual threads and added together once all threads return. You can see the code here . Below is the result: creating a frequency list for a 140~MB-large file utilizing four threads on a quad-core machine can be 83% faster than single-threading the same operation: You should expect to see this discovery taken into account in the next release. Another major change I'm planning for the next release is making the Segmenter, Clusterer and FrequencyList classes generic so that ' print ' as verb can be analyzed as a separate entity from ...