Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Weather App (2015) Concurrency and Error Handling Making Our Code Asynchronous

Janelle Boyd
Janelle Boyd
1,833 Points

When would you want to use synchronous processing?

Could you please provide an example of when someone building an app would ever want to use synchronous processing?

2 Answers

Jannelle,

Synchronous programming is mainly done when you have to control the order of operations and know the outcome of each operation before moving to the next. The first one that comes to mind is working with banking transactions where you need to be sure that a deposit was completed before you can allow them to remove the money. If the first doesn't complete but you allow them to remove the money they thought they just deposited in check form, you might be giving out money their account doesn't have.

That's just one. I'm sure other students can come up with more examples.

Ron

Andrew Sheragy
Andrew Sheragy
16,379 Points

Isn't the answer to this just whenever you don't need asynchronous processing? Which is a majority of time.