

public class SynchronizedTask {
	
	public synchronized void reduce_memory(SeverList serverlist_list,TaskList tasklist_list)
	{
		serverlist_list.rest_Memory = serverlist_list.rest_Memory - tasklist_list.get_need_Memory();	
		System.out.println(serverlist_list.rest_Memory);
		serverlist_list.rate_memory = (int)((1 - (float)(serverlist_list.rest_Memory)/serverlist_list.get_all_Memory()) * 100);
	}
	public synchronized  void add_memory(SeverList serverlist_list,TaskList tasklist_list)
	{
		serverlist_list.rest_Memory = serverlist_list.rest_Memory + tasklist_list.get_need_Memory();	
		System.out.println(serverlist_list.rest_Memory);
		serverlist_list.rate_memory = (int)((1 - (float)(serverlist_list.rest_Memory)/serverlist_list.get_all_Memory()) * 100);
		
		serverlist_list.exec_task++;	
	}


}
