Linked by nfeske on Thu 23rd Aug 2012 08:30 UTC
OSNews, Generic OSes The just released version 12.08 of the Genode OS Framework comes with the ability to run Genode-based systems on ARM hardware without an underlying kernel, vastly improves the support for the NOVA hypervisor, and adds device drivers for the OMAP4 SoC. Further functional additions are a FFAT-based file system service, the port of the lighttpd web server, and support for on-target debugging via GDB.
Permalink for comment 532454
To read all comments associated with this story, please click here.
RE[6]: Good Progress
by Alfman on Sun 26th Aug 2012 17:11 UTC in reply to "RE[5]: Good Progress"
Alfman
Member since:
2011-01-28

nfeske,

"Your example does indeed subvert the locking scheme. But as Genode does not provide fork(), it wouldn't work anyway. ;-)"

Shows what I know ;)


"The file-system interface is designed such that the seek offset is passed from the client to the file system with each individual file-system operation."

Makes sense. How do you handle files with the append flag?

int f=open("xyz", O_WRONLY | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
sleep(1);
write(f, "1", 1);
sleep(1);
write(f, "2", 1);
close(f);

Running two instances of this program simultaneously on linux produces "1122". However if libc uses a process-local file offset, then it would probably output "12". I imagine you just ignore the offset that gets passed for files opened in append mode?


"To prevent falling into the premature-optimization trap, I'd first try to obtain the performance profile of a tangible workload."

A simple test here on an arbitrary linux system:

char buffer[1000];
int f=open("xyz", O_RDWR | O_APPEND | O_CREAT, S_IRUSR | S_IWUSR);
for(i=0; i<1000000; i++) {
/* TEST 1
off_t old = lseek(f, 10, SEEK_CUR);
lseek(f, 10, SEEK_SET);
read(f, &buffer, sizeof(buffer));
lseek(f, old, SEEK_SET);
*/
/* TEST 2
pread(f, &buffer, sizeof(buffer), 10);
*/
}

I recorded the fastest time of 3 runs...
buffer size=1
TEST 1 - seek + read = 1.072s
TEST 2 - pread = 0.663s

buffer size=1000
TEST 1 - seek + read = 1.254s
TEST 2 - pread = 0.882s

buffer size=10000
TEST 1 - seek + read = 3.636s
TEST 2 - pread = 3.183s


I'm a little surprised that even with a 10K buffer size, there's still a very noticeable half-second difference with the lseek syscall approach on linux. I suspect Genode-Noux would exhibit similar trends. But does it matter? That depends on who we ask. Sometimes design factors are worth some additional overhead. There are always trade offs.

Reply Parent Score: 2