From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by hurricane.the-brannons.com (Postfix) with ESMTPS id CF6317789A for ; Sat, 31 Aug 2019 12:05:04 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id z11so10078636wrt.4 for ; Sat, 31 Aug 2019 12:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=geoffair-info.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=WvM6Oq77HIwOMSmZZkG3lqDm4H1w0PXopHH62rPA4tw=; b=J+yV1I95THqAJDaV4toX57jMMeD6jHFMzgo7ajMmKsmohgoUMO8JrR7sOFnj4+c59R b5ibwOyUrk32g0VAwlRAoXjWm+DQDZeZfanlzYt5it9q7kqQXUt1BRjpjVoJ3Jkekvqh 1pP90IU+AmBY//DNhIjwRZ2Z/OVqzzrYtc2xtf6HRMaq6PkmxMwb1accosaz8wgNiUht Ny/pXMVg2VQhrxSVBdpOGPvadEjyBEj3RnAkX0aQhTnaOVKy8rF13WmBZSQ8fR0DdYL1 4RIKfJ+XeVdQhFm9NMHiP36/LBaOACJ67Bl6in6Yk9a3k2IoA5gDDXKFfIBJkdqv7ULw lQbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=WvM6Oq77HIwOMSmZZkG3lqDm4H1w0PXopHH62rPA4tw=; b=L3yeUsnspOr4ISnnUTeRkk9Unw8rzaYlM0cv4Mo3N6gPbYJl9+9TxuWLZAFzQ1rpe4 IHqBRSLRBqeXb1ib7ePVtd5NFHlojgi5LoqQVFVGY0GDVQ3VV9q9EW7HIcn1DeCD45Zt NmD2WA9zkMtenJLGRP1TU5Nac0Zc1HdiwkTtMHHEE+5OdOepVsffQdP6AEYYfNLI1GN3 9hVzenJLzi13kVSstrjdG4lEsWB7I+JLJQIi7wye8h0weoMNu5tWbObOgu1u8tIOPPJA WiZR0Ci4VYTkTYbGVH58JA1vzmw9YKlk6ZzkcR8lgVtac1FBSznL80HsWs3PctuhSH+K L5Xw== X-Gm-Message-State: APjAAAWm1wk9alLZDmCdb4jQGeKZxgzxULPNwUtig37htl0xapPJln9n 1PgaJ5dik+TT0MOkYw3F1PkpXYCWm2I= X-Google-Smtp-Source: APXvYqy5BVFEhbcGfqbiU5oC2IPRDWe+prmCduwMZfU3Mi/Z27tyTOqT5C8Awdw+LRfc1ezDzwPHAA== X-Received: by 2002:a5d:460e:: with SMTP id t14mr27510205wrq.171.1567278302901; Sat, 31 Aug 2019 12:05:02 -0700 (PDT) Received: from [192.168.1.16] (lfbn-idf2-1-265-150.w82-123.abo.wanadoo.fr. [82.123.105.150]) by smtp.googlemail.com with ESMTPSA id y3sm19524124wmg.2.2019.08.31.12.05.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 31 Aug 2019 12:05:02 -0700 (PDT) Subject: Re: [edbrowse-dev] Threads (fwd) To: Edbrowse-dev@lists.the-brannons.com References: <20190730180859.eklhad@comcast.net> From: Geoff McLane Message-ID: <3f5e0abd-ae6e-746c-3d95-78d3882f66a8@geoffair.info> Date: Sat, 31 Aug 2019 21:05:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 X-BeenThere: edbrowse-dev@edbrowse.org List-Id: Edbrowse Development List MIME-Version: 1.0 In-Reply-To: <20190730180859.eklhad@comcast.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Hi Karl, Yes, the overrun has nothing to do with threading... I only ran into it running the special MSVC Debug build, which has a special prologue to write a marker, like oxcc, to ALL stack variable, and an epilogue that checks for invasions... of various types... very special case... And since in this case it seemed just by 1 byte, although there could have been others, which 'normally' will not cause a problem, so long as it is not killing a variable still in use, then the results are totally unpredictable... Maybe will not have time tonight to pull and test your latest... Ok, concerning 'creat()', I too think this system call would be 100% thread safe, why not? so I did what you suggested - found some simple code here - https://www.technical-recipes.com/2016/using-posix-threads-in-microsoft-visual-studio/ ... copied in your 'creat(buf, 0666)'... into the perform_work thread... and BANG got an exception... I was overlooking your permission value... 0666... the exception is an 'invalid parameter' dialog... when I replace that with '_S_IREAD | _S_IWRITE', 0x0180, everything ran smooth... 5 threads create, 5 temp files created... no problems... So this solves it in my mind... what about you? Will get to a pull soonest... Regards, Geoff.