In recent years, with the smartening of equipment in the industry, Industrial Internet of Things (IIoT) has gained significant attention and holds great importance as it leads to improved quality of services and products, cost reduction, increased speed, and enhanced efficiency of devices. IIoT devices generate large volumes of data, requiring parallel data processing and timely access to be effective. Therefore, real-time data processing is crucial because data must be available within a specific timeframe to be efficient for the intended device, ensuring that operations are conducted correctly. Acquiring information after the specified timeframe might be useless or even hazardous. Additionally, preventing resource wastage and improving their efficiency and performance is essential to enhance the overall system's efficiency and performance. This research aims to propose an efficient scheduling algorithm to ensure that tasks are processed in a timely manner, thereby reducing resource wastage and enabling the processing of more tasks, ultimately minimizing the number of lost tasks. The proposed algorithm has been evaluated in the CloudSim simulator, and the evaluation results indicate a 7% improvement in resource utilization and a 16% reduction in lost tasks.