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 / Managed C++ / February 2005

Tip: Looking for answers? Try searching our database.

Multithreading

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alper AKCAYOZ - 23 Feb 2005 10:15 GMT
Hello,
I am developing a TCP/IP Client application in Windows Forms (.NET)
template. I use one MDI form as initial form where I connect to server and
starts a background thread (thread_A) for receiving data. Here, I use the
Socket_A

By clicking a toolbarbutton, I send a command to server. If it is
successfull, I opened the MDI-Child form with "frmChildForm->Show();" command.
I create two more sockets (Socket_B, Socket_C) at child form and start
receiving continuously (in while-loops) with two threads (Thread_B,
Thread_C). I display the data coming from these sockets on 25 textboxes
(Thread_B with Socket_B) and on 3 data-grids (Thread_C with Socket_C). These
operations must be as fast as possible. Thread_B and Thread_C are not sharing
any data, they are independent.

I could not speed up the data-receving which means I could not order Threads.
I read several documents at MSDN like ThreadPool, Monitor. But I could not
solve my problem. I put several "Thread::Sleep(...);" in Thread_B and
Thread_C, but it is not still working properly. Data on textboxes and
datagrids are not changing fast, sometimes some values are stucking.

I am requesting a way to make use of Threads more efficiently.?

I thank you so much in advance.

Signature

İyi Çalışmalar
Alper AKÇAYÖZ (Bil Muh)

Wish You Good Work
Alper AKCAYOZ (Bil Muh)

Ioannis Vranos - 23 Feb 2005 11:33 GMT
> Hello,
> I am developing a TCP/IP Client application in Windows Forms (.NET)
[quoted text clipped - 20 lines]
>
> I thank you so much in advance.

I know .NET multithreading. In .NET, for thread synchronization you need
to use lock-based multithreading,  by getting and release the thread
lock. This is done by using some .NET facilities which include
Monitor::Enter() to acquire the lock, Monitor::Exit() to release the
lock, however the lock is released implicitly in a Monitor::Wait() call.

A nice beginner to intermediate level book that you can read, and covers
all .NET facilities, and covers multithreading as also networking among
them, is "Visual C++ .NET How To Program" by Deitel.

http://vig.prenhall.com/catalog/academic/product/0,1144,0134373774,00.html

Signature

Ioannis Vranos

Vladimir Nesterovsky - 23 Feb 2005 12:32 GMT
Two points:

1. I'd rather used remoting or web services to communicate with a server,
then custom socket protocol.
2. UI need not be faster then human beings. This means that there is no
point to update view too fast.
Signature

Vladimir Nesterovsky
e-mail: vladimir@nesterovsky-bros.com
home: www.nesterovsky-bros.com

> I am developing a TCP/IP Client application in Windows Forms (.NET)
> template. I use one MDI form as initial form where I connect to server and
[quoted text clipped - 17 lines]
>
> I am requesting a way to make use of Threads more efficiently.?

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.