Apparatus and method for managing resource
An apparatus for managing a resource includes a buffer memory; and a processor configured to store, when target data for each of processes is acquired, the acquired target data in the buffer memory, the processes occurring asynchronously and periodically and being assigned degrees of priority, and assign a shared resource to some of the processes for which the target data is stored in the buffer memory in descending order of the priority at every predetermined timing, the shared resource being usable for each of the processes.
1 . An apparatus for managing a resource, comprising:
a buffer memory; and
a processor configured to
store, when target image data for each of a plurality of processes is acquired from one of a plurality of cameras generating the target image data, the acquired target image data in the buffer memory, the processes occurring asynchronously and being assigned degrees of priority,
assign a shared resource to some of the processes for which the target image data is stored in the buffer memory in descending order of the priority at predetermined timing intervals, the shared resource being usable for each of the processes, wherein the shared resource is an operating circuit that performs object detection on image data received from the buffer memory,
executing a process of the plurality of processes having the highest priority with the assigned shared resource, and
releasing the shared resource when executing the process is completed;
wherein each of the predetermined timing intervals at which the shared resource is assigned to some of the processes is set to be the same as a timing interval that a camera among the plurality of cameras having the highest priority writes image data to the buffer memory;
wherein only when an expected time required for executing a first process other than the process having the highest priority is shorter than a waiting time for release of the shared resource to a next timing of writing the image data generated by the camera having the highest priority to the buffer memory, the processor assigns the shared resource to the first process at the release of the shared resource.
2 . The apparatus according to claim 1 , wherein the target image data for the processes is sensor signals obtained from different sensors mounted on a vehicle.
3 . The apparatus according to claim 2 , wherein the processor is further configured to set the degrees of priority of the processes, depending on the state of travel of the vehicle.
4 . A method for managing a resource, comprising:
storing, when target image data for each of a plurality of processes is acquired from one of a plurality of cameras generating the target image data, the acquired target image data in a buffer memory, the processes occurring asynchronously and being assigned degrees of priority;
assigning a shared resource to some of the processes for which the target data is stored in the buffer memory in descending order of the priority at every predetermined timing, the shared resource being usable for each of the processes, wherein the shared resource is an operating circuit that performs object detection on image data received from the buffer memory,
executing a process of the plurality of processes having the highest priority with the assigned shared resource, and
releasing the shared resource when executing the process is completed;
wherein each of the predetermined timing intervals at which the shared resource is assigned to some of the processes is set to be the same as a timing interval that a camera among the plurality of cameras having the highest priority writes image data to the buffer memory;
wherein only when an expected time required for executing a first process other than the process having the highest priority is shorter than a waiting time for release of the shared resource to a next timing of writing the image data generated by the camera having the highest priority to the buffer memory, assigning the shared resource to the first process at the release of the shared resource.