[OSy] Testy pro rozsirena zadani

David Matousek david at matousec.com
Wed Jan 2 18:32:10 CET 2008


Zdravim,

chtel bych se jen ujistit, ze nasledujici implementace ve funkci thread_proc
v souboru spinlock2\test.c je zamyslena tak jak je:

---
	for (cnt = 0; cnt < CYCLE_COUNT; cnt++) {
		spinlock_lock (& counter_lock);

		/*
		 * Get a copy of the counter, wait a while and store an
		 * increment of the local counter. If the spinlockes don't work,
		 * the counter will be damaged.
		 */
		local_counter = counter;
		thread_usleep (SLEEP_TIME_MS * 1000);
		counter = local_counter + 1;

		spinlock_unlock (& counter_lock);
	}
---

Konkretne bych poprosil o potvrzeni, ze skutecne chcete zamykat spinlock a potom se uspat.

Jeste bych zminil, ze rwlocky pouzivaji jina jmena funkci nez jsou v zadani,
ale to neni velky problem.


Dekuji,

DM




More information about the NSWI004 mailing list