Tasks

IN PROGRESS

1) Share thread state between kernel and userland, see Solaris schedctl http://docs.oracle.com/cd/E19455-01/806-0630/6j9vkb8hv/index.html

21:18 <@kib> davide, yes, ONCPU/OFFCPU.

21:19 <@kib> they also prevent descheduling of the spinning thread, AFAIR

21:22 <@kib> davide, IMO we must explicitely define the structure used to communicate between kernel and libthr

21:22 <@kib> the structure might be embedded into the stuct thread

21:24 <@kib> davide, you store the pointer to the structure into the lock

21:24 <@kib> davide, if needed, the struct thread * can be easily calculated from the embedded struct pointer

21:25 <@kib> offsetof()

21:27 <@kib> davide, the comm structure is interpreted by kernel

21:27 <@kib> if struct thread needs to be changed, you immediately get the ABI problem if kernel accesses it

21:28 <@kib> comm would initally contain only sc_oncpu (in solaris language)

21:28 <@kib> and padding for the future use

TODO

2) Easy way to access thread owner state. Need thread to write 'struct pthread' address in the owner field of the umtx lock.

3) Implement adaptive spinning for mutexes (as done in kernel)

4) Replace msleep() calls with direct calls to the scheduler (ask attilio)

5) umtx hashtable spinlock -> mutex_padalign

umtxcontention (last edited 2013-07-09 16:12:57 by DavideItaliano)