[MUD-Dev] Re: lurker emerges

Petri Virkkula pvirkkul at iki.fi
Tue Aug 11 10:52:55 CEST 1998


>>>>> "Alex" == T Alexander Popiel <popiel at snugharbor.com> writes:

Alex> For reference, I only started Java two years ago, and before and
Alex> during that, I've been a big UNIX and C (_not_ C++) fan.  Java is
Alex> not my first exposure to multithreading issues (I also do MUSHcode
Alex> which exhibits many of the same problems), but I generally view
Alex> multithreading in terms of the large amount of overhead it brings.

	I have different view to multithreading. I used to be
	programming embedded systems (smart card readers), and
	multithreading (though we used term multitasking even though
	there was only no address space and no memory protection
	(80188/V20/V25/V30 does not have a MMU), except because the
	code was in ROM) was very helpful to make the code more
	modular, easier to read and often even faster.

	There was, for example, a "task" (ie. a thread) making
	different sound effects with buzzer. It received a request to
	play sound pattern through single interface function. The task
	was most of the time waiting on semaphore, but when it
	received a request, it played the requested sound pattern
	sequentially (buzzer on, sleep x milliseconds, buzzer off,
	sleep y milliseconds, buzzer on, sleep z milliseconds, buzzer
	off, and so on) without need to care about other tasks.

	IMHO multithreaded program can be cleaner and more modularized
	resulting code that can be tested more easily. That's enough
	for me in most cases to use threads even if there is small
	speed penalty.


	Petri




More information about the mud-dev-archive mailing list