Subject:
|
Re: IS free()'s operation atomic?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 29 Apr 1999 20:26:37 GMT
|
Viewed:
|
1367 times
|
| |
| |
Jiro Eto <arcadia@ylw.mmtr.or.jp> wrote:
> Hi all
>
> I think that free() operation in mm.c is not ISR safe in multitasking
> mode. This operation is not keep coherence about value of
> mm_first_free,is it?
> ------------ in mm.c -----------------
> // for task safe operations, free needs to be
> // atomic and nonblocking, because it may be
> // called by the scheduler.
> //
> // therefore, just update mm_first_free
> //
> if(ptr<mm_first_free || mm_first_free<&mm_start)
> mm_first_free=ptr;
> ----------------------------------------
> Please any advice me.
I agree, free() is not ISR safe. One thread can get preempted after the
check but before the store, and a second thread can adjust mm_first_free,
making the first thread's check invalid.
-Kekoa
|
|
Message is in Reply To:
| | IS free()'s operation atomic?
|
| Hi all I think that free() operation in mm.c is not ISR safe in multitasking mode. This operation is not keep coherence about value of mm_first_free,is it? ---...--- in mm.c ---...--- // for task safe operations, free needs to be // atomic and (...) (26 years ago, 29-Apr-99, to lugnet.robotics.rcx.legos)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|