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

Submitter:  White_FrosT
Submitted:  Wed 13 Jul 2005 10:53:31 PM UTC
   
 
Category:  Core Severity:  3 - Normal
Item Group:  Compilation problem Status:  Fixed
Assigned to:  None Open/Closed:  Closed
Release:  2.5.30.17 Release: 
Operating System:  FreeBSD Binaries Origin:  None
CPU type:  Intel x86

Jump to the original submission

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

Solved in current version

spiralvoice <spiralvoice>
Group 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>
Group 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>
Group 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

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

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

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 5 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-01-23 spiralvoice StatusNeed Info Fixed
    Open/ClosedOpen Closed
2006-01-15 spiralvoice Attached File- Added freebsd_thread2.patch, #3277
2005-07-20 beedauchon StatusNone Need Info
2005-07-13 White_FrosT Carbon-Copy- Added white_frost

Back to the top

Powered by Savane 3.13-02a9.
Corresponding source code