updating the Linux kernel

j at cnb.uam.es j at cnb.uam.es
Mon Jun 12 12:34:04 PDT 2000


-----BEGIN PGP SIGNED MESSAGE-----

Sic, that'll teach me not to write messages when I'm so tired. Of course
in the last example the signal handler was incomplete, as I was thinking
of setjmp/longjmp's. It might work out like

<j at cnb.uam.es> wrote:
> 
> 	start_subjobs();

	  setjmp(start_waiting);	/* long explanation here please */

> 	set_timeout(now+long_enough, my_sig_handler);
> 	wait_for_answers
> 	when an answer arrives {
> 		save_it_for_later
		  answers_got++		/* note possible race condition here */

> 	}
> 	consolidate_all_answers
> 	show_user
> ...
> 	my_sig_handler() {
	     if (answers_got < n)	/* we may get caught after the
					answer but before the increment */

> 		check_all_nodes_are_alive
> 		if someone_failed {
> 			consolidate_answers_to_date
> 			show_user
> 			if (user_is_glad)
> 				OK
> 			else
> 				die_miserably
> 		}

		  else
			/* start another waiting loop */
			longjmp(start_waiting);

> 	}
> 

Resolving the grace condition gracefully is a nice treat, but I won't go
into more depth under my current mental conditions (too tired). It is an
easy task if the other logic is correctly coded.

The nice thing about such an scheme is that in principle it should be
independent of other underlying facilities, it's not that hard to code
and should work. OTOH it uses some arcane coding tricks like jmp's
largely forgotten and may be considered ugly as a GOTO.

Seeya,
				j


-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv

iQEVAwUBOUU7LLgsTQLvQjxFAQGH4gf/SgbLkxujsmlEQChhc5U+3xxtytEHhMPJ
xwT07jBiziaWvSoPtKS94smoXagwJwJYdOg6QkLcubrQH4YZMxVSTsnWy//Tbl0J
2ZF2pyvaajUTpxSkqDNfd4GAOfSt3dzz8MWBkrIsD7k5omFZXI4Q3fXmJoWE51uv
NCP/7ws369vJotOMk/RClUgoheJyC6tOJFg1aJ3/pvLwELhvn6pgIVeH3N9s5l4t
VbZsf0s3Hzy8FZ3lBfJqfe6AtgDjzuN07B1QTSVgaMoYZjgeIstHHK2V2XW+nq0j
OEDJnBV5bTder2QUapZZ2RqwkNdItEX80YjVGk6PMUL1CFeRX2W6oA==
=h4qS
-----END PGP SIGNATURE-----




More information about the Beowulf mailing list