Post

Replies

Boosts

Views

Activity

Reply to Is Atomic property thread safe
Can you please answer my questions as is in apple documentations its mentioned that NSstring is thread safety: Thread Safety Objects When Apple says thread safety what do they mean: is it: crash/ no crash or the correctness of the entire value (like you gave in the above example of 2 properties)? if We look at the following property @property (nonatomic, nonnull) NSString * familyName; Without copy (I see no particular reason to set it as copy although the underline subclass is mutable, but lets assume we are not going to pass any mutable object to that property). If the following is read and written from multiple threads can it crash? can it have non correct value ? (what do you mean non thread safety in that context) From your last answer u described a case when it can crash (accessing a released object). Can you back up your answer with code snippet? Can you provide a code that will crash when you read/ write to the above property from different threads?
Topic: Programming Languages SubTopic: General Tags:
Jul ’24
Reply to Is Atomic property thread safe
Sorry but I still have few follow up question. With the above definitions can I assume that @property (nonatomic , copy, nonnull) NSString * familyName; Will also be thread safe (no crash) and the value correctness in multi thread environment. My assumption arise coz from first look I would assume that the read/write occurs to the underhand ivar and the object is immutable but I am not 100% confident if there are any additional steps in the synthesized getter/setter From what I can see Apple interpretation of thread safety is the consistency of the data across the whole objets i.e in your case is the consistency between the familyName and givenName . am I correct?
Topic: Programming Languages SubTopic: General Tags:
Jun ’24
Reply to Is Atomic property thread safe
ok so lets define couple of things. "thread safe" - lets define it as safe to use without crashing "correctness of the value" - basically what you mentioned, a consistent behavior between right and reads. Let's keep the discussion only to one property. In that case can we assume its thread safe and correctness of the value?
Topic: Programming Languages SubTopic: General Tags:
Jun ’24
Reply to Crash objc_retain_x0
@DTS Engineer both crashes occurs in 2 different places under 2 different threads. The current one is related to the processing of the payload we received from the BE and runs in sync queue. While the previous crash runs and different sync queue and its purpose is to handle app analytics as soon as one is received. With that to say its hard for me to directly link between the two issues except of some general memory corruption
Jun ’24
Reply to NSarray crashes with different exceptions from the same place
@DTS Engineer So initially we tried in our sample apps but that it didnt yield any result. So I took client compiled app, compiled the SDK with Sanitizers and injected it to the client app. (I have linked the ASAN libs to prevent crashes when the app cant find those libs SDK refers to) . I tried mainly the Address Sanitizer tool (it seems like the most appropriate)
Jun ’24
Reply to NSarray crashes with different exceptions from the same place
Hi, Thanks for your help. Yes Yes Currently one client reported about the issue (I tend to believe there might be more clients with the same issue) wanted to point out that I managed to reproduce the following crash on the client app: Thread 182: EXC_RESOURCE (RESOURCE_TYPE_MEMORY: high watermark memory limit exceeded) (limit=1450 MB) . That happens when the data is to big , it should not happen and we will fix it BUT no guarantee it will solve their issue
Jun ’24