[OSy] System calls - question (cz/sk)

Slávka Ivaničová slavka.ivanicova at gmail.com
Mon Nov 26 13:56:00 CET 2018


Zdravím, vedel by mi, prosím, niekto objasniť zopár vecí k téme System
calls z Operačných systémov?

V súbore kernel/proc/sys_thread.c je fukcia sys_thread_join (uintptr_t tid,
void **thread_retval), ktorá má spojiť thread (join a thread).

Chápem to tak, že fukcia robí nasledovné:
// check that the tid pointer points to a safely mapped user memory,
if (tid != NULL && !vma_check_user((void*)tid, sizeof(struct uthread))) {
return ENOMEM;
}
// check whether the requested thread to join is a valid thread of the
current process.
process_t process = thread_get_process ();
uthread_t uthread = NULL;
/* Disable interrupts while accessing shared structures. */
ipl_t state = query_and_disable_interrupts ();
// convert the thread ID to the actual user thread control structure
(uthread_t).
uthread = (uthread_t)tid;
// the process control structure (process_t) contains a list of valid user
threads.
conditionally_enable_interrupts (state);

if (uthread == NULL) return EINVAL;

// call the appropriate kernel function
// vykoná "join a thread"
return thread_join(uthread->thread, thread_retval);

Mojou otázkou je, či je potrebné v tejto fukcií prechádzať zoznam
process->uthread_list a porovnať, či sa uthread nachádza v zozname.

Ďakujem.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://d3s.mff.cuni.cz/pipermail/nswi004/attachments/20181126/9e863b40/attachment.html>


More information about the NSWI004 mailing list