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

[nptl] Re: SCHED_RR issue



> SUS doesn't distinguish between thread creation and thread execution. An ADA
> guys might see this as a mistake... But anyway... 
> That's the way it is. See for instance the rational of the 
> pthread_create() XSH:
> http://www.opengroup.org/onlinepubs/000095399/functions/pthread_create.html
> 
> <copy>
>     A suggested alternative to pthread_create() would be to define two
> separate operations: create and start. Some applications would find such
> behavior more natural. Ada, in particular, separates the "creation" of a
> task from its "activation".
> ...
> ...
> </copy>
> 

In this same rationale:

<copy>
An Ada implementor can choose to create the thread at either of two
points in the Ada program: when the task object is created, or when the
task is activated (generally at a "begin"). If the first approach is
adopted, the start_routine() needs to wait on a condition variable to
receive the order to begin "activation". The second approach requires no
such condition variable or extra synchronization.
</copy>

The last part means (IMHO) that after a call to pthread_create() in a
POSIX program, the effects are the same that after a call to both
create() and activate() in an Ada program, doesn't it? At least, this is
how I understand it.

Furthermore, in the NPTL implementation, the pthread_create() routine
calls the clone() syscall, so I *think* (not sure) that, *in this
particular implementation*, the threads will be created/started in the
same order than pthread_create() was called...

Thanks,
Seb :-"

-------------------------------
Sebastien DECUGIS
NPTL Test & Trace Project
http://nptl.bullopensource.org/

"You may fail if you try.
You -will- fail if you don't."


Liste de diffusion nptl
Pour se désinscrire : mailto:nptl_request@bullopensource.org?subject=unsubscribe