Jean-Paul Calderone wrote:
> On Wed, 15 Feb 2006 12:59:03 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]>
> wrote:
>
>> Steve Horsley wrote:
>>
>>> [EMAIL PROTECTED] wrote:
>>>
>>>
thread1:
while 1:
buf = s.read()
process(buf)
threa
Bryan Olson wrote:
> Carl J. Van Arsdall wrote:
>
>> Steve Horsley wrote:
>>
>>
>>> [EMAIL PROTECTED] wrote:
>>>
>>>
>>>
thread1:
while 1:
buf = s.read()
process(buf)
thread2:
while 1:
buf = getdata()
Carl J. Van Arsdall wrote:
> Steve Horsley wrote:
>
>> [EMAIL PROTECTED] wrote:
>>
>>
>>> thread1:
>>> while 1:
>>> buf = s.read()
>>> process(buf)
>>>
>>> thread2:
>>> while 1:
>>> buf = getdata()
>>> s.write(buf)
>>
>>
>> It is safe, but watch out fo
In article <[EMAIL PROTECTED]>,
Bryan Olson <[EMAIL PROTECTED]> wrote:
> Is it safe for one thread to receive from a socket while
> another sends over the socket? Yes, that much is safe and
> perfectly reasonable.
I hear it works on most common platforms these days,
anyway. I have seen socket i
On Wed, 15 Feb 2006 12:59:03 -0800, "Carl J. Van Arsdall" <[EMAIL PROTECTED]>
wrote:
>Steve Horsley wrote:
>> [EMAIL PROTECTED] wrote:
>>
>>> thread1:
>>> while 1:
>>> buf = s.read()
>>> process(buf)
>>>
>>> thread2:
>>> while 1:
>>> buf = getdata()
>>> s.wr
[EMAIL PROTECTED] wrote:
> thread1:
> while 1:
> buf = s.read()
> process(buf)
>
> thread2:
> while 1:
> buf = getdata()
> s.write(buf)
Sockets don't have read() and write() methods. Connected
sockets have recv() and send()/sendall(). Python's socket
module
Steve Horsley wrote:
> [EMAIL PROTECTED] wrote:
>
>> thread1:
>> while 1:
>> buf = s.read()
>> process(buf)
>>
>> thread2:
>> while 1:
>> buf = getdata()
>> s.write(buf)
>>
>>
>
> It is safe, but watch out for this gotcha: If thread B calls
> s.close
[EMAIL PROTECTED] wrote:
> thread1:
> while 1:
> buf = s.read()
> process(buf)
>
> thread2:
> while 1:
> buf = getdata()
> s.write(buf)
>
It is safe, but watch out for this gotcha: If thread B calls
s.close() while thread A is blocked in s.read(), thread
[EMAIL PROTECTED]:
>[code]
I certainly expect socket to be threadsafe. I use it (via urllib2/httplib)
in a multithreaded program, that runs fine with Python 2.3 and 2.4 on both
Windows XP and Linux.
--
René Pijlman
--
http://mail.python.org/mailman/listinfo/python-list
thread1:
while 1:
buf = s.read()
process(buf)
thread2:
while 1:
buf = getdata()
s.write(buf)
--
http://mail.python.org/mailman/listinfo/python-list
10 matches
Mail list logo