mldonkey-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mldonkey-users] TODO list


From: Pierre Etchemaite
Subject: Re: [Mldonkey-users] TODO list
Date: Sat, 21 Dec 2002 22:32:36 +0100

Le Sat, 21 Dec 2002 17:03:56 +0100, MLdonkey <address@hidden> a écrit
:

> Ocaml does not support multi-threading very nicely. Maybe a
> two-threads version, where one thread would be responsible only for
> MD4 computation (which is mainly C code that will not conflict with
> ocaml code). But multi-threading means synchronizations, deadlocks
> and many other problems (including OS/compilation/portability problems).

What about processes instead ?

Create a pipe and fork(*) a "slave" process when mldonkey starts; The slave
process receives filename, offset and size, and returns the MD4 of the
file part. One could even add request identifiers (a la IMAP protocol),
echoed with answers to avoid mistakes, and even queue some requests ahead...
All you need is to disable writes to those parts while it's
hashing, but writes are already disabled for completed chunks, could it be
handled by just another chunk state ? (VerificationInProgress ?)

BTW, on IRC (#mldonkey on irc.openprojects.org), Avengence also suggested
doing commits in a background thread/process, for people that have temp and
incoming directories on separate filesystems...


(*) ok, fork() is not only emulated on Windows. Maybe the slave process
should be a separate program, so we can fork() + exec() on Unixish systems,
and WinExec() on Windowsish systems ?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]