Go Back  Xtreme Visual Basic Talk > General Discussion > Tech Discussions > Threads


Reply
 
Thread Tools Display Modes
  #1  
Old 04-08-2003, 02:38 PM
HiTmAN's Avatar
HiTmAN HiTmAN is offline
Contributor
 
Join Date: Mar 2003
Location: The FSB
Posts: 570
Question Threads


What exactly is a thread? (in a program, not these forums )
Sorry if im sounding ignorant.
Reply With Quote
  #2  
Old 04-08-2003, 02:47 PM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default

A thread is basically a path of execution through a program. It is also the smallest unit of execution that Win32 schedules. A thread consists of a stack, the state of the CPU registers, and an entry in the execution list of the system scheduler. Each thread shares all of the process’s resources.

A process consists of one or more threads and the code, data, and other resources of a program in memory. Typical program resources are open files, semaphores, and dynamically allocated memory. A program executes when the system scheduler gives one of its threads execution control. The scheduler determines which threads should run and when they should run. Threads of lower priority may have to wait while higher priority threads complete their tasks. On multiprocessor machines, the scheduler can move individual threads to different processors to “balance” the CPU load.

Each thread in a process operates independently. Unless you make them visible to each other, the threads execute individually and are unaware of the other threads in a process. Threads sharing common resources, however, must coordinate their work by using semaphores or another method of interprocess communication.

(I cut and paste good, no?)
Reply With Quote
  #3  
Old 04-08-2003, 02:49 PM
HiTmAN's Avatar
HiTmAN HiTmAN is offline
Contributor
 
Join Date: Mar 2003
Location: The FSB
Posts: 570
Default

so basically, the point of a creating a new thread in a progam would be to execute multiple parts at once?
Reply With Quote
  #4  
Old 04-08-2003, 02:51 PM
reboot's Avatar
reboot reboot is offline
Keeper of foo

Retired Moderator
* Guru *
 
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
Default

Multiple operations executing at the same time. Yes.
Reply With Quote
  #5  
Old 04-08-2003, 02:52 PM
HiTmAN's Avatar
HiTmAN HiTmAN is offline
Contributor
 
Join Date: Mar 2003
Location: The FSB
Posts: 570
Default

ok thanks for clearing that up for me
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
threads with winsock...threads dta Communications 24 07-30-2002 01:19 PM
Thread(s) with errors Nordwind 64 General 3 06-08-2002 03:25 PM
Thinker, Please don`t stop answearing my threads Homie Tech Discussions 6 04-20-2002 10:24 AM
Virgin Threads Bob Schwarz, Sr. Tech Discussions 12 01-29-2002 01:58 PM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->