Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #25846

Re: gForth and unix/pthread.fs

From Bernd Paysan <bernd.paysan@gmx.de>
Newsgroups comp.lang.forth
Subject Re: gForth and unix/pthread.fs
Date 2013-09-20 19:07 +0200
Organization 1&1 Internet AG
Message-ID <l1hvcu$15u$1@online.de> (permalink)
References (1 earlier) <1d98259a-6699-4929-80cf-1022147dd1a6@googlegroups.com> <l1g17c$m9g$1@online.de> <24d1514e-0155-4b43-a88d-bb274c855887@googlegroups.com> <l1hlir$kfk$1@online.de> <d2aaa163-6953-44b1-a862-60e5b04194b8@googlegroups.com>

Show all headers | View raw


VoidVolker wrote:

>> BTW: The right way to use threads is *not* to create/destroy them
>> frequently, use worker threads which wait for commands.  Ok, that's what
>> I'm doing, and that's what doesn't trigger this problem.
>> 
> 
> Yes, this is what I do. At program start create threads and mutex, then
> the threads just wait mutex unlock, work, and wait again mutex. Simple and
> fast.

How many threads are you creating?  I've now changed the code so that it 
works better through unexpected failures, and is more robust in general, but 
the whole problem is still a bit strange.

My impression is that glibc's memory management is not really thread-safe, 
and that this causes severe problems.  I've enabled malloc checks to get a 
chance to print meaningful error messages in Forth, but that seems to rather 
increase the number of potential problems...

-- 
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://bernd-paysan.de/

Back to comp.lang.forth | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

gForth and unix/pthread.fs voidvolker@gmail.com - 2013-09-16 00:43 -0700
  Re: gForth and unix/pthread.fs anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2013-09-16 09:05 +0000
    Re: gForth and unix/pthread.fs voidvolker@gmail.com - 2013-09-16 05:43 -0700
  Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-19 10:14 -0700
    Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 01:26 +0200
      Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-19 19:17 -0700
        Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 16:20 +0200
          Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-20 08:43 -0700
            Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 19:07 +0200
              Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-20 19:14 +0200
                Re: gForth and unix/pthread.fs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-09-21 05:02 -0500
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 15:55 +0200
                Re: gForth and unix/pthread.fs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-09-21 11:32 -0500
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 20:44 +0200
                Re: gForth and unix/pthread.fs Andrew Haley <andrew29@littlepinkcloud.invalid> - 2013-09-22 05:03 -0500
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-22 21:18 +0200
                Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-21 11:41 -0700
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 21:18 +0200
                Re: gForth and unix/pthread.fs VoidVolker <voidvolker@gmail.com> - 2013-09-21 13:55 -0700
                Re: gForth and unix/pthread.fs Bernd Paysan <bernd.paysan@gmx.de> - 2013-09-21 23:40 +0200
              Re: gForth and unix/pthread.fs albert@spenarnc.xs4all.nl (Albert van der Horst) - 2013-09-21 12:59 +0000

csiph-web