Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 18 Jul 2003 15:46:56 -0400 (EDT)
From:      Daniel Eischen <eischen@vigrid.com>
To:        threads@freebsd.org
Subject:   Rearranging kse mailbox
Message-ID:  <Pine.GSO.4.10.10307181538360.18280-100000@pcnet5.pcnet.com>

next in thread | raw e-mail | index | archive | help
Before we switch from libkse to libpthread, let's take a look
at the mailboxes and see if we want to reorder them for better
alignment.

I took a cut at it.  I moved the context from the beginning
of the thread mailbox to the end since it was the largest
field and most likely to change (for non-i386 archs).

struct kse_thr_mailbox {
	struct kse_thr_mailbox	*tm_next;	/* Next thread in list */
	void			*tm_udata;	/* For use by the UTS */
	uint32_t		tm_flags;	/* Thread flags */
	uint32_t		tm_uticks;
	uint32_t		tm_sticks;
	uint32_t		tm_spare2[9];
	siginfo_t		tm_syncsig;
	ucontext_t		tm_context;	/* User and machine context */
};

struct kse_mailbox {
	uint32_t		km_version;	/* Mailbox version */
	uint32_t		km_flags;	/* KSE flags */
	struct kse_thr_mailbox	*km_curthread;	/* Currently running thread */
	struct kse_thr_mailbox	*km_completed;	/* Threads back from kernel */
	sigset_t		km_sigscaught;	/* Caught signals */
	kse_func_t		*km_func;	/* UTS function */
	stack_t			km_stack;	/* UTS context */
	void			*km_udata;	/* For use by the UTS */
	struct timespec		km_timeofday;	/* Time of day */
	int32_t			km_quantum;	/* Upcall quantum in msecs */
	uint32_t		km_spare[8];
};

Comments, suggestions?

-- 
Dan Eischen




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.10.10307181538360.18280-100000>