phage
phage

Reputation: 588

Multi-threading using a share socket in Haskell

In Haskell, can the same socket be shared between two threads? Essentially, what I am trying to do is create a thread to write to a socket and another to read from the socket.

The read thread would be a loop that constantly wait, monitor and pick up any messages generated by the socket.

Another thread (the write thread) would send code to the socket.

Please advise.

Upvotes: 1

Views: 142

Answers (1)

Thomas M. DuBuisson
Thomas M. DuBuisson

Reputation: 64750

Yes, this is allowed.   

Upvotes: 2

Related Questions