lkml.org 
[lkml]   [2003]   [Mar]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: read() & close()
Date
Hi,
I have come across this problem when implementing a sockets
interface to our X.25 card. On the thread that wants to close the socket,
it must first issue a shutdown(). This will unblock the read() or poll().
And then you can do the close().


Kevin

-----Original Message-----
From: bert hubert [mailto:ahu@ds9a.nl]
Sent: 20 March 2003 15:08
To: Filipau, Ihar
Cc: 'linux-kernel@vger.kernel.org'
Subject: Re: read() & close()


On Thu, Mar 20, 2003 at 03:14:52PM +0100, Filipau, Ihar wrote:

> I have/had a simple issue with multi-threaded programs:
>
> one thread is doing blocking read(fd) or poll({fd}) on
> file/socket.

You can't do poll on a file, it won't tell you anything useful, so I assume
you mean a socket.

> another thread is doing close(fd).
>
> I expected first thread will unblock with some kind
> of error - but nope! It is blocked!

Can you show code with this problem?

Regards,

bert

--
http://www.PowerDNS.com Open source, database driven DNS Software
http://lartc.org Linux Advanced Routing & Traffic Control HOWTO
http://netherlabs.nl Consulting
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.019 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site