linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* multi threaded file access
@ 2002-12-06 11:39 Heinrich du Toit
  2002-12-06 13:38 ` ruler
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich du Toit @ 2002-12-06 11:39 UTC (permalink / raw)
  To: linux-c-programming mailing list

Hello

I have a tcp/ip server which is offcourse multi threaded :-)

Is it safe to have to threads access the same file descriptor at the 
same time?
Or should I put a mutex over the file descriptor?

Thanks for your help
-Heinrich



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: multi threaded file access
  2002-12-06 11:39 multi threaded file access Heinrich du Toit
@ 2002-12-06 13:38 ` ruler
  0 siblings, 0 replies; 2+ messages in thread
From: ruler @ 2002-12-06 13:38 UTC (permalink / raw)
  To: linux-c-programming

Hello Heinrich,

Friday, December 6, 2002, 6:39:29 AM, you wrote:

HdT> Hello

HdT> I have a tcp/ip server which is offcourse multi threaded :-)

HdT> Is it safe to have to threads access the same file descriptor at the 
HdT> same time?
HdT> Or should I put a mutex over the file descriptor?

HdT> Thanks for your help
HdT> -Heinrich


HdT> -
HdT> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
HdT> the body of a message to majordomo@vger.kernel.org
HdT> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Put a mutex over the writing to file descriptor.  Depends on how much
and what you are writing, it could makes lines combine with each other
into a bunch of garbled letters.

Thanks,

-- 
Best regards,
 ruler                            mailto:ruler@isolate.net



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-12-06 13:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-12-06 11:39 multi threaded file access Heinrich du Toit
2002-12-06 13:38 ` ruler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).