Erl Ports and Threads

Chenniappan,Dhanasekaran [DBA] dhanasekaran.c@REDACTED
Wed Dec 22 06:38:42 CET 2004


Hi, 
 I am ODBC module for Microsoft SQL server. I am struggling with call a
stored procedure, If anybody have some working example (With MS SQL stored
procedure) please help me.

With Regards
Dhanas

-----Original Message-----
From: Per Hedeland [mailto:hedeland@REDACTED] 
Sent: Thursday, December 16, 2004 3:41 PM
To: casper2000a@REDACTED
Cc: erlang-questions@REDACTED; klacke@REDACTED
Subject: Re: Erl Ports and Threads

klacke@REDACTED wrote:
>
>On Thu, Dec 16, 2004 at 03:37:34PM +0600, Casper wrote:
>> Hi Klacke,
>> 
>> Thanks for the response.
>> 
>> Here I am not talking about simultaneous write() operations on a
socket/pipe
>> from the multiple external program. I am talking about multiple threads
in
>> one program.
>
>I know, that's what you wrote.
>
>> 
>> Is single write() call, atomic or not?
>> 
>
>Not.

<nitpick>
Actually this isn't entirely true - when different processes write to
the same pipe, their writes are guaranteed (on a standards-compliant
Unix:-) to be atomic if they are "small enough" - from a decent
pathconf(2) man page:

     _PC_PIPE_BUF
             The maximum number of bytes which will be written atomically to
a
             pipe.

(The number is typically 4096 or so.) Whether this is still true for
different threads in a process writing to the same pipe I don't know,
but I would expect so (might be implementation-dependant though). And of
course relying on the undocumented fact that the port communication
channel *is* a pipe, and not e.g. a local socket which doesn't have such
guarantees, isn't a very good idea.
</nitpick>

For all practical purposes, I agree with Klacke's answer.:-)

--Per



More information about the erlang-questions mailing list