Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6567881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:23:22+00:00 2026-05-25T14:23:22+00:00

Is it possible to create thread local data in a linux kernel module? I

  • 0

Is it possible to create thread local data in a linux kernel module?

I need to store some data for each process/thread calling my module.
Is there an easy way of using thread local data, or do I have to resort to
writing a hash map which uses the pid of the current process as a key?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:23:22+00:00Added an answer on May 25, 2026 at 2:23 pm

    Assuming the interface to you kernel module is a character device driver, then you have a private_data field in the file struct (which is analogous to user space file descriptor) exactly for that.

    Just allocate and assign a pointer to your structure of choice at the open file operation to it.

    It’s not exactly thread or process local, but in most cases a mapping of one file descriptor to your process is true and it might be good enough for you.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Normally controls are created at the main thread. Is it possible to create some
I need to know if it is possible to create a new thread to
Possible Duplicate: Create a temporary directory in Java Duplicate: stackoverflow.com/questions/375910 Is there a way
I need to create a thread in Delphi with the following characteristics: Waits until
Is it possible to create multiple jobs with in a single thread? I am
Is there a way to create a thread in Qt without using subclassing (ie.
Is it possible to pass a relative path to create my child process? This
I was wondering if its possible to create a Thread and kill/finish The Activity,
Is it possible to create a thread pool using boost's thread? i was looking
Is it possible to create a factory or proxy that can decide if thread

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.