Re: thead security
- From: "seawind" <wangdongyu3d@xxxxxxxxxxx>
- Date: 9 Feb 2007 02:07:50 -0800
On 2月8日, 上午11时37分, Sam <s...@xxxxxxxxxxxxxx> wrote:
seawind writes:
HI all:
Call poll() function at two threads, and the important is the two
threads are waitting for the same socket descriptor . one of them is
set POLLIN , the other is set POLLOUT. What i want to know is whether
i should protect the socket descriptor by using lock. thanks advance
Nope. No need to do any locking, as long as you understand what you're
doing. There's nothing wrong with one thread writing to a socket, and
another thread reading from the same socket. As long as you understand the
basic concepts of thread programming and logic, and as long as you know how
to properly handle any exception or error conditions, no locking is
required.
application_pgp-signature_part
1K下载
thanks alot
.
- References:
- thead security
- From: seawind
- Re: thead security
- From: Sam
- thead security
- Prev by Date: Re: I dcfldd'd a 40GB to a 120GB - drive reads as 40GB
- Next by Date: Re: LDAP + Proxy + Browser
- Previous by thread: Re: thead security
- Next by thread: Support for distro entrenched
- Index(es):
Relevant Pages
|