bugmldonkey, a multi-networks file-sharing client - Bugs: bug #13790, Configure finds pthread but there...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #13790: Configure finds pthread but there are not used

Submitted by:  White_FrosT
Submitted on:  Wed 13 Jul 2005 10:53:31 PM UTC  
 
Category: CoreSeverity: 3 - Normal
Item Group: Compilation problemStatus: Fixed
Assigned to: NoneOpen/Closed: Closed
Release: Release: 2.5.30.17
Operating System: FreeBSDBinaries Origin: None
CPU type: Intel x86

(Jump to the original submission Jump to the original submission)

Mon 23 Jan 2006 12:11:57 AM UTC, comment #6:

Solved in current version

spiralvoice <spiralvoice>
Project Administrator
Sun 15 Jan 2006 04:56:23 PM UTC, comment #5:

Another possibility: Ocaml ./configure

if test "$pthread_wanted" = "yes"; then
...
if ./hasgot -i pthread.h $pthread_link pthread_self; then
...
if sh ./hasgot $pthread_link sigwait; then
echo "sigwait() found"
echo "#define HAS_SIGWAIT" >> s.h
fi
...

HAS_SIGWAIT is only defined on platforms where pthread is used,
unfortunately no Ocaml define exists for HAS_PTHREAD, but
HAS_SIGWAIT could additionally be used to determine whether
MLDonkey uses threads or not. See the attached patch.

spiralvoice <spiralvoice>
Project Administrator
Thu 18 Aug 2005 08:36:58 PM UTC, comment #4:

In mldonkey source:
~/mldonkey#grep PTHREAD config/config.h
#define HAVE_PTHREAD 1
/* #undef PTHREAD_CREATE_JOINABLE */

In Ocaml source:
~/ocaml-3.08.4#grep GETHOST config/s-templ.h
#define HAS_GETHOSTNAME
/* Define HAS_GETHOSTNAME if you have gethostname(). */
#define HAS_GETHOSTBYNAME_R 6
/* Define HAS_GETHOSTBYNAME_R if gethostbyname_r() is available.
#define HAS_GETHOSTBYADDR_R 8
/* Define HAS_GETHOSTBYADDR_R if gethostbyname_r() is available.

White_FrosT
Wed 20 Jul 2005 04:32:12 PM UTC, comment #3:

There need to be several things present in order to let MLDonkey
use threads:

Buildinfo uses:
if BasicSocket.has_threads () then " threads" else " no-threads"

in basicSocket.ml there is this code:
external has_threads : unit -> bool = "ml_has_pthread"

which is used in ./src/utils/lib/stubs_c.c:
#if !defined(HAVE_PTHREAD) || !(HAS_GETHOSTBYNAME_R || GETHOSTBYNAME_IS_REENTRANT)
...
value ml_has_pthread(value unit)
{ return Val_false; }
#else
...
value ml_has_pthread(value unit)
{ return Val_true; }
#endif

In ocaml/caml/config.h I have this line on Linux:
#define HAS_GETHOSTBYNAME_R 6

GETHOSTBYNAME_IS_REENTRANT is used for Windows systems (code from stubs_c.c):
#ifdef _WIN32
#define GETHOSTBYADDR_IS_REENTRANT 1
#define GETHOSTBYNAME_IS_REENTRANT 1
#endif

So, in order for the core to recognize threads properly two things
must be present on your non-Windows system:

mldonkey/config/config.h
/* Define if you have POSIX threads libraries and header files. */
#define HAVE_PTHREAD 1

and

In ocaml/caml/config.h I have this line on Linux:
#define HAS_GETHOSTBYNAME_R 6

from Ocaml sourcecode, config/s-templ.h
#define HAS_GETHOSTBYNAME_R 6

/* Define HAS_GETHOSTBYNAME_R if gethostbyname_r() is available.
The value of this symbol is the number of arguments of
gethostbyname_r(): either 5 or 6 depending on prototype.
(5 is the Solaris version, 6 is the Linux version). */

Either one of this is missing on your system. Please let me know what.

spiralvoice <spiralvoice>
Project Administrator
Wed 20 Jul 2005 02:32:29 PM UTC, comment #2:

'Update status > need info'

What information do you need? Configure finds pthread support. In 'top' I see more than one thread, but 'help'>'buildinfo' says 'no-threads'.

Anonymous
Tue 19 Jul 2005 03:17:21 PM UTC, comment #1:

'top' suggests that threads are actually used.

White_FrosT
Wed 13 Jul 2005 10:53:31 PM UTC, original submission:

./Configure output:
checking for pthread_join in LIBS=/usr/lib/libpthread.so with CFLAGS=... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... -D_THREAD_SAFE

When running mlnet command buildinfo:
Features: no-threads

I'm confused now, what's going on?

White_FrosT

 

Attached Files
file #2191:  freebsd_thread2.patch added by spiralvoice (585B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 5 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 23 Jan 2006 12:11:57 AM UTCspiralvoiceStatusNeed Info=>Fixed
  Open/ClosedOpen=>Closed
Sun 15 Jan 2006 04:56:23 PM UTCspiralvoiceAttached File-=>Added freebsd_thread2.patch, #3277
Wed 20 Jul 2005 01:25:04 PM UTCbeedauchonStatusNone=>Need Info
Wed 13 Jul 2005 10:53:31 PM UTCWhite_FrosTCarbon-Copy-=>Added white_frost

Back to the top


Powered by Savane 3.1-cleanup1