mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-10-31 13:20:59 +00:00 
			
		
		
		
	LibWeb: Add "parallel queue" and allow it as fetch task destination
Note that it's not actually executing tasks in parallel, it's still throwing them on the HTML event loop task queue, each with its own unique task source. This makes our fetch implementation a lot more robust when HTTP caching is enabled, and you can now click links on https://terminal.shop/ without hitting TODO assertions in fetch.
This commit is contained in:
		
							parent
							
								
									9a5ef95022
								
							
						
					
					
						commit
						03256a2543
					
				
				
				Notes:
				
					github-actions[bot]
				
				2025-07-16 22:14:47 +00:00 
				
			
			Author: https://github.com/awesomekling
Commit: 03256a2543
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5471
			
					 10 changed files with 65 additions and 44 deletions
				
			
		|  | @ -77,4 +77,17 @@ UniqueTaskSource::~UniqueTaskSource() | |||
|     s_unique_task_source_allocator.deallocate(static_cast<int>(source)); | ||||
| } | ||||
| 
 | ||||
| NonnullRefPtr<ParallelQueue> ParallelQueue::create() | ||||
| { | ||||
|     return adopt_ref(*new (nothrow) ParallelQueue); | ||||
| } | ||||
| 
 | ||||
| TaskID ParallelQueue::enqueue(GC::Ref<GC::Function<void()>> algorithm) | ||||
| { | ||||
|     auto& event_loop = HTML::main_thread_event_loop(); | ||||
|     auto task = HTML::Task::create(event_loop.vm(), m_task_source.source, nullptr, algorithm); | ||||
|     event_loop.task_queue().add(task); | ||||
|     return task->id(); | ||||
| } | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling