DragonFly BSD
DragonFly kernel List (threaded) for 2003-07
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

API noodling


From: peter@xxxxxxxxxxx (Peter da Silva)
Date: Tue, 22 Jul 2003 16:24:03 -0500 (CDT)

>     hahahaha.  dragonthread... hahahaha.

I assumed there was a dragon:thread Pern pun in 'dragonfly'.

> :> 	       * Use the convenient mostly pre-built message stored in the
> :> 	       * userthread structure
> :> 	       */
> :> 	      msg = &curthread->td_sysmsg;
> :
> :msg = &curthread->td_sysmsg[READ] or something like that, no?
> 
>     Not unless you want your user thread structure to become hugely bloated!

I was thinking of caching them, not bothering to init the message structure
for a given message type until it was used the first time.

	if (!curthread->td_sysmsg[READ]) {
		curthread->td_sysmsg[READ] = malloc(...);
		... initialise the type and size fields for READ ...
	}

Also, don't you need to tell it *which* system call it's using somewhere? :)

Using a union won't give you prebuilt templates for the versionless
universal compatibility sceme you were talking about.

>     A user thread will only be in one direct system call interface 
>     (i.e. read(), write(), gettimeofday()) at a time, so a single 
>     union'd syscall message structure embedded in the lwkt_thread is
>     sufficient.

Two... one for when it's in a signal... if signals aren't handled in a
separate thread.




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