FreeRTOS Support Archive
The FreeRTOS support forum is used to obtain active support directly from Real
Time Engineers Ltd. In return for using our top quality software and services for
free, we request you play fair and do your bit to help others too! Sign up
to receive notifications of new support topics then help where you can.
This is a read only archive of threads posted to the FreeRTOS support forum.
The archive is updated every week, so will not always contain the very latest posts.
Use these archive pages to search previous posts. Use the Live FreeRTOS Forum
link to reply to a post, or start a new support thread.
[FreeRTOS Home] [Live FreeRTOS Forum] [FAQ] [Archive Top] [January 2009 Threads] typedef void * xQueueHandle; and ansi cPosted by GregK on January 31, 2009 Hi
I have trivial question (I hope), I do not understand something.
situation:
task: //======================================= extern xQueueHandle xQueue; //ours queue
while(xQueue == NULL) //wait on till queue will be created in other task { delay(10); }
xQueueSendToBack(xQueue,...); (...) //========================================
So we creating a queue in other task, this task just waiting on when queue is created. xQueueHandle is defined: typedef void * xQueueHandle; My doubts are: is it safe if to declare handler to queue like non volatile pointer? General rule is that volatile type should be for example: "Global variables accessed by multiple tasks within a multi-threaded application" I understand this like: typedef void * volatile xQueueHandle;
What are yours thoughts ?
Kind Regards /Greg
RE: typedef void * xQueueHandle; and ansi cPosted by Richard on January 31, 2009 I think technically you are correct, you may need a volatile on the definition, depending on the compiler and optimisation level used.
Regards.
RE: typedef void * xQueueHandle; and ansi cPosted by GregK on February 2, 2009 I checked 2 another RTOS and non of them declare non volatile pointers. It seems that neither compiler use such optimization, because is really unlike that no one report bug yet.
Regards
Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.
|