---
title: "Discussion on \"Task.Run vs. QueueUserWorkItem\" | Hashnode"
description: "Discussion on \"Task.Run vs. QueueUserWorkItem\". Using ThreadPool.QueueUserWorkItem:\n\nHelps bypass limitations when trying to run async code inside IHttpModule.\n\nDoes not interfere with the ASP.NET pipeline.\n\nEmail sending does not block the main thread.\n\nCalling SendMailAsync().Wait() is safe here..."
url: "https://hashnode.com/posts/taskrun-vs-queueuserworkitem/680657f6521c53acef547b78"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Task.Run vs. QueueUserWorkItem](https://karatas.dev/taskrun-vs-queueuserworkitem?utm_source=hashnode&utm_medium=feed)

Using ThreadPool.QueueUserWorkItem: Helps bypass limitations when trying to run async code inside IHttpModule. Does not interfere with the ASP.NET pipeline. Email sending does not block the main thread. Calling SendMailAsync().Wait() is safe here...

Apr 21, 2025 · 2 min read · karatas.dev  
Read the article

-   [#queueuserworkitem](https://hashnode.com/tag/queueuserworkitem)

## Written by

[Ferhat Karataş](https://hashnode.com/@karatas)

@karatas · Turkey

  
[View profile](https://hashnode.com/@karatas)

Software Developer

Performance freak

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
