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

查看:54
本文介绍了在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中线程安全是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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