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

  • SEARCH
  • Home
  • 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 7067017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:09:02+00:00 2026-05-28T05:09:02+00:00

I’m looking at modifying a toy OS system and I’m just trying to learn

  • 0

I’m looking at modifying a toy OS system and I’m just trying to learn some of the code and what it does. I have been given a “Thread” structure which has as a member a “pcb” structure, which is a process control block that interfaces the thread to the underlying physical hardware I guess.

Anyways, in this “pcb” structure there’s the initialization function which initializes the pcb of a newly created thread. Here’s the function definition:

void md_initpcb(struct pcb *, char *stack, void *data1, unsigned long data2,
    void (*func)(void *, unsigned long));

With regards to the code, what is the meaning of the last argument? Does it relate to the code or instructions

Conceptually, I’m confused about how stuff fits into the bigger picture. From what I know, a Thread is a unit of execution of code; for example it can relate to user programs, so switching between threads rapidly gives the illusion of running processes in parallel. Alright so this Thread then needs its own stack, registers (don’t understand), and some control (the pcb).

Sorry if this is kind of all over the place. For reference, I’m starting the OS161 project.

Thanks.

  • 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-28T05:09:03+00:00Added an answer on May 28, 2026 at 5:09 am

    It’s a function pointer. You pass it the address of a function that returns void and takes a void pointer and an unsigned long.

    So, for example, if you have a function:

    void myfunc(void *data, unsigned long number);
    

    Then you could pass it as the fourth argument to md_initpcb.

    This function is the code that the thread you’re creating is going to execute. When it finishes, the thread will finish too.

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to loop through a bunch of documents I have to put
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is

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.