开发人员在使用多线程时会遇到哪些常见陷阱? [英] What are some common pitfalls developers run into with multi-threading?

查看:59
本文介绍了开发人员在使用多线程时会遇到哪些常见陷阱?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
什么是常见的并发陷阱?

Possible Duplicate:
What are common concurrency pitfalls?

我具有线程的基本知识,没有具体知识.我和一些同事正在研究认证,而我们正在讨论多线程这一章.

I have basic knowledge of threading, nothing specific. Some co-workers and I are studying for a certification and we are on the chapter about multi-threading.

在实现多线程应用程序时,您会犯一些常见的错误?

What are some common mistakes you make when implementing a multi-threaded application?

在开发多线程应用程序时,我们应该注意什么陷阱"?

When developing a multi-threaded app, are there any "gotchas" we should look out for?

推荐答案

多线程应用程序的经典难题是两个不同的线程同时修改同一内存.解决此问题的方法称为同步.

The classic difficulty with multithreaded applications is two different threads modifying the same memory at the same time. The method of solving this problem is called synchronization.

在此处查看我的更完整答案.

这篇关于开发人员在使用多线程时会遇到哪些常见陷阱?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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