[M3devel] threading on Windows?

Mika Nystrom mika at async.caltech.edu
Sun Feb 13 00:39:15 CET 2011


Tony, 

I have yet to find a single system on which my thread testing program
actually runs properly under pthreads.  I have however managed to get
it to work everywhere with user threading.  

My last email to you on the issue said the following:

read:  segfault after a long time
fork:  OK
alloc: deadlock
creat: appears OK for a long time then hangs hard (can't get into debugger)
lock:  OK

I think Jay has now fixed the "read" problem, which had nothing to do with
threading but was a TRY-EXCEPT issue.  The fact that the runtime deadlocks
when NEWing objects I think is the most serious problem. 

Could you try it, please?  If you run "threadtest -n 10 -tests all" you
should see something like this (the following is AMD64_FREEBSD with user
threading---the numbers denote how much threads are lagging, in seconds).
The program is utterly standard Modula-3.

/big/home/mika/cm3-writable/cm3/m3-libs/m3core/tests/thread/AMD64_FREEBSD/threadtest -n 10 -tests all
Writing file...done
Creating read threads...done
Creating nxread threads...done
Creating tryexcept threads...done
Creating fork threads...done
Creating alloc threads...done
Creating creat threads...done
Creating lock threads...done
running...printing oldest/median age/newest
..........laziest thread is 56/13/0 (tests: read 1/1/0 nxread 3/2/2 tryexcept 12/8/3 fork 13/13/13 alloc 17/15/13 creat 38/17/17 lock 56/18/17)
..........laziest thread is 57/13/0 (tests: read 2/1/0 nxread 3/2/2 tryexcept 12/8/3 fork 13/13/13 alloc 17/15/13 creat 36/17/17 lock 57/36/17)
..........laziest thread is 40/13/0 (tests: read 1/1/0 nxread 3/2/1 tryexcept 12/8/3 fork 13/13/13 alloc 17/15/13 creat 37/17/17 lock 40/37/17)
..........laziest thread is 34/14/0 (tests: read 1/0/0 nxread 3/2/1 tryexcept 13/9/3 fork 14/14/14 alloc 17/15/14 creat 31/17/17 lock 34/31/17)
..........laziest thread is 56/13/0 (tests: read 2/1/0 nxread 3/2/2 tryexcept 12/8/3 fork 13/13/13 alloc 16/15/13 creat 37/16/16 lock 56/18/16)
..........laziest thread is 37/14/0 (tests: read 1/0/0 nxread 3/2/1 tryexcept 13/8/3 fork 14/14/14 alloc 18/15/14 creat 37/19/19 lock 37/19/19)
..........laziest thread is 34/15/0 (tests: read 2/1/0 nxread 3/3/2 tryexcept 14/9/3 fork 15/15/15 alloc 16/16/15 creat 34/17/17 lock 34/17/17)
..........laziest thread is 34/14/0 (tests: read 1/1/0 nxread 3/2/1 tryexcept 13/8/3 fork 14/14/14 alloc 16/15/14 creat 34/16/16 lock 34/16/16)
..........laziest thread is 35/14/0 (tests: read 2/1/0 nxread 3/2/2 tryexcept 13/9/3 fork 14/14/14 alloc 17/16/14 creat 35/17/17 lock 35/17/17)
..........laziest thread is 37/14/0 (tests: read 2/1/0 nxread 3/2/2 tryexcept 13/8/3 fork 14/14/14 alloc 16/15/14 creat 37/17/17 lock 37/17/17)
All tests complete.  Congratulations.

  
     Mika

Tony Hosking writes:
>Mika,
>
>I have no idea what the issue is here.  But I do note that AMD64_LINUX =
>with pthreads used to run just fine.  I ran a bunch or stress tests when =
>first ported to that target and all seemed good.  What is preventing you =
>using pthreads on this target?
>
>-- Tony
>
>On Feb 11, 2011, at 8:57 PM, Mika Nystrom wrote:
>
>> I would like to find one configuration (any configuration!!) that lets
>> me run a multithreaded program under AMD64_LINUX.  I don't care what
>> version of the compiler it is, whether the threads are user or =
>pthreads,
>> how many things I have to hack.  Does anyone know what I need to do?



More information about the M3devel mailing list