[M3devel] DateBsd.m3 lock usually not needed

Tony Hosking hosking at cs.purdue.edu
Thu Dec 17 04:41:29 CET 2009


Yes, heap allocation can happen while switching is disabled.

On 7 Dec 2009, at 00:01, jay.krell at cornell.edu wrote:

> Clarfication, I meant traced heap allocation, the copying of timezone. Could copy to local array then enable switching then alloc/copy. But what I did should be ok.
> 
>  - Jay (phone)
> 
> On Dec 6, 2009, at 11:14 AM, Tony Hosking <hosking at cs.purdue.edu> wrote:
> 
>> On 6 Dec 2009, at 09:29, Jay K wrote:
>> 
>>> I was thinking of that -- DisableSwitching / EnableSwitching -- but can the heap allocation happen while
>>> switching is disabled?
>> 
>> Yes, it sure can.  DisableSwitching/EnableSwitching is exactly what is needed whenever you are dealing with libraries that are not thread safe with the user-level thread-switching.
>> 
>>> I came up with something a bit hacky but maybe ok.
>>> 
>>>  - Jay
>>> 
>>> 
>>> Subject: Re: [M3devel] DateBsd.m3 lock usually not needed
>>> From: hosking at cs.purdue.edu
>>> Date: Sun, 6 Dec 2009 09:25:58 -0500
>>> CC: m3devel at elegosoft.com
>>> To: jay.krell at cornell.edu
>>> 
>>> That's what SchedulerPosix (badly named but linked to the old user-threads naming) is for....
>>> 
>>> Antony Hosking | Associate Professor | Computer Science | Purdue University
>>> 305 N. University Street | West Lafayette | IN 47907 | USA
>>> Office +1 765 494 6001 | Mobile +1 765 427 5484
>>> 
>>> 
>>> 
>>> 
>>> On 6 Dec 2009, at 06:48, Jay K wrote:
>>> 
>>> It'd be nice if DateBsd.m3 only used a lock with user threads and not with pthreads/ntthreads.
>>> 
>>>  - Jay
>>> 
>>> 
>> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091216/d21ef641/attachment-0002.html>


More information about the M3devel mailing list