s-hunter
s-hunter

Reputation: 25816

Is it possible run multiple tasks parallelly in one thread in Java?

When creating a new Thread or Runnable in Java, are they the smallest unit of processing/computation environment one can create? Is it possible to run multiple tasks asynchronously within one Thread?

Upvotes: 1

Views: 449

Answers (1)

Adrian
Adrian

Reputation: 46452

By definition, no. In order for two operations to execute in parallel, they must be in separate threads or processes.

Upvotes: 1

Related Questions