What is thread?

What do t-shirts and computer programs have in common? They both consist of many threads! While the threads in the T-shirt hold the fabric in the form of a single fabric, C Thread (literally “threads” or “threads”) of the operating system combines all the programs in order to perform sequential or parallel actions simultaneously. Each thread in the program identifies the process that starts when the system (system Thread C) requests it. This optimizes the operation of such a complex device as a personal computer and positively affects its speed and productivity.

Definition

In computer science, C Thread, or the thread of execution, is the smallest sequence of commands that are controlled by an independent scheduler, which is usually an integral part of the operating system.

c thread




, , . , , . , . , «», . Thread . , , .





«» ( Thread) -. - . , , . «» «», , .

C Thread Windows

— . — . .

, , . , .

C Thread task

, , . -, , JavaScript Flash. , , .

, . . , . , .

thread sleep c








. . , . , .

, . . , , ( , ).

— , .

. , , , . : , - , .

c thread task




, , . , . , C Thread .

: (CPU) . , , , ​​ .

, , ​​ , . , (LWP) — , . , (Thread timer C), , , ad hoc.

:

:

  • , ;

  • , ;

  • ;

  • ;

  • , .

. . , , . , .

c thread join




2000- . , . 2002 . Intel Pentium 4, Hyper-Threading. 2005 . Pentium D AMD Athlon 64 X2.

, , .

.

1: 1 ( ) — , , . OS/2 Win32 , Linux C Thread join NPTL LinuxThreads. Solaris, NetBSD, FreeBSD, macOS iOS.

N: 1 ( ) — , . , , , , . , . : -, . GNU Portable C Thread exception .

M: N ( ) — N , « ». («1: 1») («N: 1»). «M: N» , , . M: N . , . , ( ) .

std thread c




— , POSIX NetBSD ( M: N, 1: 1, ).

, Solaris ( Std Thread C).

. C C++ API- . , Java, Python .NET Framework, . . .

windows c thread




, , - (GIL). GIL — , , , .

, Tcl, Thread sleep C. GIL, , «» .

, , Verilog, Thread sleep C, , .

c thread exception




, . . , , , , , , .




All Articles