Question: I'm new in programming, actually I use it for Machine Learning.
I have installed python and anaconda (I don't know if that is right, or I have to install only anaconda?).
And I can see in start menu: (Anaconda powershell, Jupyter, Spyder, Anaconda navigator, Anaconda prompt).
So my question is: Do I still have to use vscode as IDE, or one of the listed programs that come with anaconda? If the answer is the second choice, I will ask, which one of them?

Thanks.

I'm using python just because I have a project in ML, So I must to set the necessary things for ML, like libraries, dataset, and algorithms. Then I have to learn how to use them.
Any help will be very apprecheated.

Answer: 
Use [`@Async`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/annotation/Async.html)
=====================================================================================================================================

In a Web Application, creating Threads manually isn't the right way to go. This process is constful, and it's better to maintain a Pool of Threads.

Since you're using Spring Boot, everything you need is annotate the configuration class with [`@EnableAsync`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/annotation/EnableAsync.html) and [`ThreadPoolTaskExecutor`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/concurrent/ThreadPoolTaskExecutor.html) would be configured for you under the hood. You can customize it via `application.properties` (for instance, specify the required min/max pool size).

And to tell that a certain method should be executed in a different Thread, you need to place annotation [`@Async`](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/scheduling/annotation/Async.html) on it (*note that this method should reside in a class managed by Spring, i.e. annotated with one of the stereotype annotations* `@Component`, `@Controller`, etc.).

```
@Async
public Advert saveAdvert(Advert advert) {
    Advert advertToSave = advertRepository.save(advert);

    try {
        populateAdvertSearch(advertToSave);
    } catch (ParseException e) {
        e.printStackTrace();
    } catch (OfficeNotFoundException e) {
        e.printStackTrace();
    } catch (OfficePropertyNotFoundException e) {
        e.printStackTrace();
    }

    return advertToSave;
}

```
Well, it's not a good idea to terminate a running thread from the outside, but if you want so, you can use `ExecutorService`.

Let's say you want to kill specific thread after 5 seconds;

```
if (executor.awaitTermination(5, TimeUnit.SECONDS)) {
  // continue
} else {
  // force shutdown
  executor.shutdownNow();
}

```