dolbi
dolbi

Reputation: 2250

async_schedule vs workqueue in linux

I'm looking for some guidelines on which cases to use what mechanism. More specific I'm trying to create collisions in a unit-test. I want multiple contexts to inject a bunch of requests to test it. I have seen an example with workqueues, and, created my own test with async_schedule. So I want to know what method fits best this scenario and why?

Also some guidelines for the future will be appreciated.

I know workqueues can handle multiple tasks queued to them. And that async_schedule will most likely open a separate kthread for each task.

Upvotes: 2

Views: 1111

Answers (1)

TheCodeArtist
TheCodeArtist

Reputation: 22507

async_schedule internally uses workqueues..

You could achieve the same using create_singlethread_workqueue() i.e multiple workqueues each with its own thread to execute "work".

More details in this chapter on workqueues from LDD3.

Upvotes: 3

Related Questions