* Hangs in fopen() in multi-threaded app
@ 2005-01-21 7:05 Brian C. Wiles
0 siblings, 0 replies; only message in thread
From: Brian C. Wiles @ 2005-01-21 7:05 UTC (permalink / raw)
To: cygwin
I am writing an app that for the most part uses only one thread but
creates a temporary thread once in a while to generate reports and email
them. The problem is when the second thread attempts to fopen() a file
for writing, it hangs. The main thread continues to run until the next
time it calls a file function (in my case, fclose() hangs). I
experience the same hangs even when I protect the code with a mutex.
Here's where it gets interesting. If I run this under my native
desktop OS (Windows XP Pro), it works fine. The hanging only happens on
my VMWare test system. Plus, my system is a P4 3.06 GHz with
Hyperthreading. I have experienced some random (although infrequent)
hangs on the native OS when running bash, etc., but I can never
reproduce them at the same spot. In my application, it always hangs in
fopen().
This leads me to ask the following:
1.) Would the known Hyperthreading issues in Cygwin happen in a
VMWare machine and not the native host? (I suppose I could disable HT
and see if it makes a difference, which I'll post the results of.)
2.) Is there anything in the file I/O routines that are not
thread-safe?
3.) Is there something else I need to do in order to avoid this
type of deadlock?
If a code sample would help, I could post one (or send privately).
My app is open source, so I'd be willing to send it off to someone if
they'd be interested. Thanks for any ideas.
-Brian
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-21 6:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-21 7:05 Hangs in fopen() in multi-threaded app Brian C. Wiles
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 read-only IMAP folder(s) and NNTP newsgroup(s).