[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH v2 4/8] lib/uksched: Introduce thread info



On 1/23/19 3:45 PM, Florian Schmidt wrote:
> Hi Costin,
> 
> On 1/11/19 12:22 AM, Costin Lupu wrote:
> 
>> For example, a preemptive scheduler might define its custom info
>> like this:
>>
>> struct thread_info_preempt {
>>      struct thread_info_base base;
>>      prio_t prio;
>>      ...
>>
>> Similar to base constructor, the preemptive abstraction constructor
>> would look like this:
>>
>> struct thread_info_preempt *
>> thread_info_preempt_create(struct uk_alloc *a,
>>          struct uk_thread_attr *attr)
>> {
>>      struct thread_info_preempt *tip;
>>
>>      tip = uk_malloc(a, sizeof(struct thread_info_preempt));
>>      thread_info_base_init(&tip->base, attr); /* init base info */
>>      tip->prio = attr->prio;
>>      ...
> 
> I have to admit I'm still a bit confused by this explanation. The
> example you give is about a preemptive scheduler's priority. Why would
> it duplicate information that is already on the thread? Or is the idea

There is nothing duplicated. uk_thread_attr is an interfacing structure
between the user/client/etc and the scheduler.

> that thread priorities might be of a different kind than the scheduler's
> priorities? But in that case, how would you set them properly,

Yeah, the scheduler can interpret those values any way it make like.

> considering that pthread is the interface? If the scheduler had more
> classes than pthread allows, you could not properly use some of them; if
> it had less, it would have to merge some pthread classes anyway. Or what
> am I missing?

I don't follow what you mean by "If the scheduler had more classes than
pthread allows".

Costin

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.