What is a worker thread and its difference from a thread which I create?

后端 未结 3 1188
野性不改
野性不改 2021-01-31 08:35

I create a thread by

Thread newThread= new Thread(DoSomeWork);

.
.
.
private void DoSomeWork()
{
}

Is this any different from a Worker thread?

3条回答
  •  一整个雨季
    2021-01-31 09:05

    I can't think of much technical difference other than mere terminology.

    Worker Threads called so because they are waiting for some job to come and does the job when assigned by someone else. For example, a web server process receives request and assign it to a thread from its pool for processing. That thread obeys the process and finishes the work and returns back to pool. Till then the main thread will be doing something else.

    For your purpose: Monitoring DB continuously is required for identifying updated/new values. It can just be a thread, running always in background, wakes up periodically and updates the values in UI from DB.

提交回复
热议问题