Erlang/OTP Forums

Author Message

<  Erlang  ~  Conceptual Problem or Code Problem?

publius
Posted: Tue Mar 09, 2010 6:21 am Reply with quote
Joined: 09 Mar 2010 Posts: 1 Location: Florida
I'm new to this Erlang thang. I haven't written code in a functional language or experimented with any sort of concurrency in my programs up till now. I'm actually a university student.

I've been reading the O'Reilly book for the past week, and tonight I set about writing my first program to test my knowledge. In brief, what it's supposed to do is open a file, tokenize each line into "words", storing them sequentially in a list, and then dividing that list amongst several processes which make trigrams out of them, storing them in an ETS bag. (Now that I write this, I realize I could have made each process tokenize the raw text rather than breaking up the program into separate steps).

The thing is, the program runs just fine, but I'm too new at this to tell whether my program "makes sense" in terms of how to do things right in Erlang. I used the timer:tc function to see if there was any improvement with 16 concurrent processes versus 1, and there didn't seem to be. That makes me think something's not right.

The bottom line is I don't know what I'm doing and would appreciate it if someone could look this over and let me know if I'm completely out of my mind.

Thanks Smile

https://pastee.org/mwckg

PS. I've attached the data file I used for testing as well as the module.
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum