Giter Club home page Giter Club logo

Comments (4)

hellosagar avatar hellosagar commented on July 18, 2024

Working of Coroutines: From a thread pool, a thread is used. and within that a corutine will be run, if another task is added to the same coroutine, that mean its in the same thread, run sequently. Once the both corutines running in the thread are done, thread will be sent back to the thread pool

Also, when we add suspend to a method, in java bytecode, it will essentially add a continousity param to the method. this continuity can stop, resume or throw exception for the running task in courtine

from android-interview-questions.

hellosagar avatar hellosagar commented on July 18, 2024

working of findViewById: for each xml tag, a there is a java class, which we get reference as view in the activity, and then we downcast to get the specific properties

from android-interview-questions.

hellosagar avatar hellosagar commented on July 18, 2024

What happens on the app start:

image

Screenshot 2024-05-23 at 11 44 54 AM

from android-interview-questions.

hellosagar avatar hellosagar commented on July 18, 2024

Dispatcher:
Responsible for deciding which thread or threads will execute your coroutines.

Dispatcher.IO vs Dispatcher.Default:

Dispatchers.Default is specifically designed for CPU-intensive tasks because it provides a fixed-size thread pool that matches the number of available CPU cores. This design ensures optimal CPU utilization, minimizes context switching overhead, and offers predictable performance. In contrast, Dispatchers.IO is better suited for I/O-bound tasks due to its elastic thread pool, which can handle a high number of blocking operations efficiently but is not suitable for CPU-bound tasks due to the risk of thread contention and starvation.

from android-interview-questions.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.