bluelinelabs / bluelinelabs/LoganSquare

Threading issue with parsing/serializing classes on separate threads

Open
#134 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
3.2k
Forks
303
PR merge metrics
No merged PRs in 30d

Description

I've come across a peculiar threading issue. It seems that parsing an object of Class X while serializing a separate object of Class X on a separate thread can cause data inconsistencies with the parsed object. I've created a sample app that demonstrates said issue.

Parsing and serializing objects of the same class should be allowed on separate threads at the same time. The use case for this functionality is parsing JSON from a database read while serializing JSON from a network response to be saved to the database.

Let me know if you need further info.
[ThreadingIssue.zip](https://github.com/bluelinelabs/LoganSquare/files/101588/ThreadingIssue.zip)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the sample app in ThreadingIssue.zip and reproduce concurrent parsing and serialization of separate objects of the same class. Trace the shared state involved in those operations and verify the result after both threads complete. Done means the sample no longer produces inconsistent parsed data when these operations run concurrently.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.