views:

213

answers:

2

How would I even go about forking a child process using Haskell in the first place?

Also, if pipes are an obvious solution to the data sharing question - is there any other way to do it besides using pipes? I'm familiar with the use of shared memory segments in C (the shmget, *shmat, shmdt and shmctl functions). Could Haskell be able to imitate this? If so, how?

I'd be very grateful for any help you could spare.

I must admit I'm very much new to functional programming languages, even more so when it comes to Haskell. So forgive me (and please correct me) if I said something silly.

+1  A: 

use MVars or Channels. See chapter 24 of RealWorld Haskell: http://book.realworldhaskell.org/read/concurrent-and-multicore-programming.html

ja
+3  A: 

Better yet, use Software Transactional Memory - that is, TVars and TChannels.

Will recommend the same book, different chapter: http://book.realworldhaskell.org/read/software-transactional-memory.html

Here is a good small example of this technique in action: http://sequence.complete.org/node/257

ADEpt