greenrobot / EventBus

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
http://greenrobot.org/eventbus/
Apache License 2.0
24.67k stars 4.66k forks source link

Default use of non daemon threads #689

Open guoci opened 2 years ago

guoci commented 2 years ago

By default, EventBus uses cached non-daemon threads and they are only removed after 60 seconds of unuse. This prevents the JVM from shutting down. System.exit() can of course be used to shut down the JVM with non-daemon threads, but requires code by the user of EventBus.

So will setting the default to creating daemon threads be a better choice?

tomridder commented 1 year ago

probably can't. because when the daemon threads and user threads finish their work,jvm will quit. but [post] method and [subscribe] method would be called durring the runtime always