在C& C中实现多线程当你走出任何单线程时杀死剩余的线程。 [英] Implement Multi Threading in C & kill the remaining Threads when you come out of any Single Thread.

查看:101
本文介绍了在C& C中实现多线程当你走出任何单线程时杀死剩余的线程。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请回答它我对多线程没有任何了解c



这是给我的截止日期请来帮助我!

解决方案

C中不存在多线程,它是操作系统的一部分。因此,要回答这个问题,您首先需要解释您正在为此程序工作的操作系统。您可以通过输入以下内容轻松地为自己做一些基础研究: https://www.google.com/search?q =多线程+ c [ ^ ]在你的浏览器中。


你应该在学校学习多线程...



正如有人已经提过的那样,你永远不应该想杀死线程。你必须以某种方式发信号线取消处理,然后等到eah线程返回。



顺便说一下,如果你不知道多线程的基本知识,那么你应该搜索一些教程。以下是一些可能性:



http:// codebase。 eu / tutorial / posix-threads-c / [ ^ ]

多线程教程 [ ^ ]

http://msdn.microsoft.com/en-us/library/y6h8hye8.aspx [ ^ ]

http://stackoverflow.com/questions/3402916/basic-multi-threading- in-cc-hints-advice-tutorial-some-direction [ ^ ]

http://www.bogotobogo.com/cplusplus/multithreading_win32A.php [ ^ ]

http://timmurphy.org/2010/05/04/pthreads-in-ca-minimal-working-example/ [ ^ ]

please answer it i dont have any idea about multi threading in c

this is given to me with a deadline pleaseee help me!

解决方案

Multithreading does not exist in C, it is part of the operating system. So, to answer this question you need first to explain which operating system you are working on for this program. And you could easily do some basic research for yourself by typing: https://www.google.com/search?q=multithread+c[^] in your browser.


You should have learn multithreading at school...

As someone has already mentionned, you should never want to kill threads. You have to signal threads somehow to cancel there processing and then wait until eah thread returns.

By the way, if you don't know the basic of multithreading, then you should search some tutorials. Here are some possibilities:

http://codebase.eu/tutorial/posix-threads-c/[^]
Multithreading Tutorial[^]
http://msdn.microsoft.com/en-us/library/y6h8hye8.aspx[^]
http://stackoverflow.com/questions/3402916/basic-multi-threading-in-c-c-hints-advice-tutorial-some-direction[^]
http://www.bogotobogo.com/cplusplus/multithreading_win32A.php[^]
http://timmurphy.org/2010/05/04/pthreads-in-c-a-minimal-working-example/[^]


这篇关于在C& C中实现多线程当你走出任何单线程时杀死剩余的线程。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆