Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Visual J# / February 2005

Tip: Looking for answers? Try searching our database.

InputStream.read doesn't block read while waiting for data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Greg Taylor - 04 Feb 2005 01:59 GMT
Using J# 1.0 library, it appears that while read is waiting for data, some
kind of "message pump" in VS 2003 allows events to fire - ON THE SAME THREAD.
So the call stack looks like:
<callback fn registered with Visual Studio event>
[<Non-user code>]
<my fn at the line where m_inputStream.read is called>
...

The callback is actually the UIHierarchy.SaveItem method for my own
UIHierarchy in VS 2003.  I expected .read to block the thread COMPLETELY,
until data was available.  Any ideas why it isn't?
jeff - 05 Feb 2005 00:26 GMT
I'm no expert in this area but if you're doing a blocking read on a UI
thread, then this wouldn't be at all surprising.  Generally speaking,
in the Windows environment, blocking on the UI thread can cause
deadlock.

-- jeff

> Using J# 1.0 library, it appears that while read is waiting for data, some
> kind of "message pump" in VS 2003 allows events to fire - ON THE SAME THREAD.
[quoted text clipped - 7 lines]
> UIHierarchy in VS 2003.  I expected .read to block the thread COMPLETELY,
> until data was available.  Any ideas why it isn't?
Lars-Inge T?nnessen [VJ# MVP] - 08 Feb 2005 20:38 GMT
In addition, if you block a UI thread the UI will not respond to paint
messages when you eg switch windows. The result is a window that does not
refresh (e.g. it will be white). You should never completely block a UI
thread.

Regards,
Lars-Inge T?nnessen

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.