answersLogoWhite

0


Best Answer

A thread is basically a lightweight process.

User Avatar

Wiki User

15y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is a thread in c?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What is thread in c language?

thread is not specific to C-language. Use wikipedia to find out what threads are, and use Posix Threads (or pthreadsfor short) to create multi-threaded programs in C


Is an EUE thread a Non-Pressure sealed thread?

EUE thread is a pressure sealed thread as usual completion pup joints thread


Can a thread create a process?

No, a thread can't create aprocess, because the environment of the thread is a part of a process which created this thread.


How do you write Multithreaded applications using C plus plus?

Use std::packaged_task (preferably) or std::thread to start a new thread. Use std::future (preferred), std::mutex or std::atomic to share information between threads.


What is an atomic operation?

An atomic operation is an operation which is guaranteed to finish in a single unit of time. This is important in synchronization where multiple threads may be trying to access a single variable at the same time. Theoretically, a situation could occur as follows: Imagine two threads are both running the same code. int c = 0; void f() { c = c + 1; } Now assume the following sequence of events takes place: # Thread0 calls f() # Thread1 calls f() # Thread0 reads c as 0 # Thread1 reads c as 0 # Thread0 increases c to 1 # Thread1 increases c to 1 # Thread0 writes back c as 1 # Thread1 writes back c as 1 We end up with c = 1. This is obviously not what was supposed to happen. Each thread was supposed to execute the code once and increase c by one, ending up with c = 2. If the (c = c + 1) statement had been atomic, each thread would read, increment, and write back c before execution was passed to any other thread.

Related questions

It keeps the thread in position?

It keeps the thread in position


How to create a thread in c?

With pthread_create.


What is thread in c language?

thread is not specific to C-language. Use wikipedia to find out what threads are, and use Posix Threads (or pthreadsfor short) to create multi-threaded programs in C


What is mean by thread in c sharp?

A thread, in any language, is an independent execution path through a program.


In Graeme Base's Animalia book on the C page what is the spool of thread that starts with c Thought of cylinder but wondered if there is another answer Thank you?

My British husband thought it could be cotton thread. It is a cotton reel


What is an average consumer unlikely to detect A hologram B digital watermark C security thread D colour-shifting ink?

security thread


What is a description of myofibrils a voluntary b intercalated discs c cardiac cells d involuntary e thread-like structures?

Myofibrils are thread-like structures


What process is used to make thread into cloth?

take 2 strips of card board.put the thread into each hole between the card board.secure with a bead or something.pull the card board tight and thread the thread or yarn or whatever through the card board thread and sqeeze to a corner.repeat till theres no space on c board thread and pull it out and tie the "loose ends"


What is meant by CPU Bound in C programming?

CPU Bound means that the thread is not waiting for any external event, such as I/O, the release of a time delay, or another thread. Long running threads such as calculations tend to be CPU Bound.It really has nothing to do with C programming. It is a generic computer term.


What are the temperatures of thread like fungi in the forest?

Thread-like fungi in the forest typically grow within a temperature range of 50-80°F (10-27°C), depending on the species. These fungi thrive in the cool, moist conditions found in forest ecosystems.


What are the methods to forcibly terminate a thread?

To end a thread within the thread's own code you can also simply return from the thread function or method. However if you want to terminate a thread from code which is running outside of the thread's own flow you must typically code a mechanism of your own to do this. A simple way to do this is to have the threaded code check a shared signal variable every so often, if the variable is signaled - then the threaded code exits and the thread dies. Terminating a process (in C with say exit(..) ) will typically force the closing of any associated threads.


What has the author A C Parkinson written?

A. C. Parkinson has written: 'Geometrical and mechanical drawing' 'Gears, gear production and measurement' 'Blueprint reading simplified' 'Thread grinding and measurement'