API noodling

Peter da Silva peter at taronga.com
Tue Jul 22 14:25:10 PDT 2003


>     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.






More information about the Kernel mailing list