Thread: Sockets and threads

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    192

    Sockets and threads

    I wanted to know a theory question about socket programming and threads. Would it be unwise to have a program that has 2 threads. One recieving on a socket and the other sending out from the same socket. Would anything collide and not actually recieve or send since there on 2 seperate threads. Or does linux sockets have its own intial queue thats avoids some kind of error to occur.

  2. #2
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    You can send and receive on the same socket at the "same time" (different threads).

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Programming chat client, need some help (sockets & threads)
    By lalilulelo17 in forum Linux Programming
    Replies: 1
    Last Post: 04-19-2008, 04:01 AM
  2. Sharing sockets among threads
    By Hawkin in forum Networking/Device Communication
    Replies: 19
    Last Post: 02-04-2008, 04:13 PM
  3. [newb] how to use threads with sockets ?
    By jabka in forum C Programming
    Replies: 1
    Last Post: 08-07-2007, 11:51 AM
  4. Library for pool, sockets, threads
    By Mortissus in forum C++ Programming
    Replies: 13
    Last Post: 07-14-2007, 07:41 AM
  5. Sockets and threads
    By karas in forum Linux Programming
    Replies: 4
    Last Post: 06-21-2007, 03:33 AM