Murali
Murali

Reputation: 21

Can we do parallel polling and ioctl on same file descriptor using multiple threads

I have a multi-threaded application in which one thread polls on a FD of my pseudo character driver. Can other threads use same FD for ioctl calls?

I am using epoll on the FD.

My guess is yes. I would like to know if anyone tried this. If so , what is the result?

Upvotes: 2

Views: 2645

Answers (1)

Dan Kruchinin
Dan Kruchinin

Reputation: 3055

Sure, they can. If your driver is written correctly (i.e. with multithreading in mind) and all shared data is properly protected, then you can do with fd everything you want (until you close it).

Upvotes: 1

Related Questions