编程技术网

关注微信公众号,定时推送前沿、专业、深度的编程技术资料。

 找回密码
 立即注册

QQ登录

只需一步,快速开始

在iOS中线程安全是什么意思?:What does it mean for something to be thread safe in iOS?

amichaud 线程 2022-5-13 09:59 32人围观

腾讯云服务器
在iOS中线程安全是什么意思?的处理方法

我经常碰到线程安全"这两个关键术语,想知道这意味着什么.例如,在Firebase或Realm中,某些对象被视为线程安全".线程安全对什么意味着什么?

I often come across the key terms "thread safe" and wonder what it means. For example, in Firebase or Realm, some objects are considered "Thread Safe". What exactly does it mean for something to be thread safe?

问题解答

线程不安全-如果允许多个线程同时修改任何对象.线程安全-如果不允许多个线程同时修改任何对象.

Thread Unsafe - If any object is allowed to modify by more than one thread at the same time. Thread Safe - If any object is not allowed to modify by more than one thread at the same time.

通常,不可变对象是线程安全的.

这篇关于在iOS中线程安全是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程技术网(www.editcode.net)!

腾讯云服务器 阿里云服务器
关注微信
^