|
Linux Forum Index » Linux Development - Applications » Information request on socket libraries...
Page 1 of 1
|
| Author |
Message |
| arnab... |
Posted: Wed Aug 06, 2008 5:21 am |
|
|
|
Guest
|
Hi All,
Information wanted for the socket libraries.I am going to use accept()
and select() system call in an multithreaded environment.Do I need to
take care of any locking mechanism when I access the above calls or I
can call them directly.
I did some google search it seems the above system calls are thread
safe, but any help or suggestion would be very much appreciated.Do I
need to take care of anything important if the code is ported both in
Solaris and Linux.
Thanks in advance.
Regards
Arnab |
|
|
| Back to top |
|
| Rainer Weikusat... |
Posted: Wed Aug 06, 2008 11:21 am |
|
|
|
Guest
|
arnab <aganguly01 at (no spam) gmail.com> writes:
Quote: Information wanted for the socket libraries.I am going to use accept()
and select() system call in an multithreaded environment.Do I need to
take care of any locking mechanism when I access the above calls or I
can call them directly.
I did some google search it seems the above system calls are thread
safe,
The UNIX(*)-specification demands that they are thread-safe. |
|
|
| Back to top |
|
| David Schwartz... |
Posted: Wed Aug 06, 2008 12:45 pm |
|
|
|
Guest
|
On Aug 6, 8:21 am, arnab <agangul... at (no spam) gmail.com> wrote:
Quote: Hi All,
Information wanted for the socket libraries.I am going to use accept()
and select() system call in an multithreaded environment.Do I need to
take care of any locking mechanism when I access the above calls or I
can call them directly.
I did some google search it seems the above system calls are thread
safe, but any help or suggestion would be very much appreciated.Do I
need to take care of anything important if the code is ported both in
Solaris and Linux.
The only issues will be with 'close'. Just like any other system
resource, you must not release a resource in one thread while another
thread is or might be using it. Otherwise, they are completely thread
safe.
DS |
|
|
| Back to top |
|
| |